'aavoya_wraq', 'p' => intval($post_id)); $button = get_posts($args); if (!empty($button)) { $aavoya_button_meta = unserialize(get_post_meta($post_id, 'aavoya_wraq_meta_key', true)); /** * Sanitizing before sending button meta back */ $aavoya_button_meta['contact7form'] = intval($aavoya_button_meta['contact7form']); $aavoya_button_meta['borderradiusvalue'] = intval($aavoya_button_meta['borderradiusvalue']); $aavoya_button_meta['paddingxvalue'] = intval($aavoya_button_meta['paddingxvalue']); $aavoya_button_meta['paddingyvalue'] = intval($aavoya_button_meta['paddingyvalue']); $aavoya_button_meta['buttonbgcolor'] = sanitize_hex_color($aavoya_button_meta['buttonbgcolor']); $aavoya_button_meta['buttontextcolor'] = sanitize_hex_color($aavoya_button_meta['buttontextcolor']); $aavoya_button_meta['buttontext'] = sanitize_text_field($aavoya_button_meta['buttontext']); $aavoya_button_meta['buttontracking'] = intval($aavoya_button_meta['buttontracking']); $aavoya_button_meta['buttonfontsize'] = intval($aavoya_button_meta['buttonfontsize']); $aavoya_button_meta['buttoncssclass'] = sanitize_html_class($aavoya_button_meta['buttoncssclass']); return $aavoya_button_meta; } return false; } /** * aavoya_araqcatc * This to create css from the provided array * @param array $args * @return string $cssAsString */ public function aavoya_araqcatc($args = null) { if ($args == null) { return false; } if (!empty($args) and is_array($args)) { $cssAsString = ''; foreach ($args as $property => $value) { switch ($property) { case 'borderradiusvalue': $cssAsString .= 'border-radius:' . intval($value) . 'px;'; break; case 'paddingxvalue': $cssAsString .= 'padding-right:' . intval($value) . 'px;'; $cssAsString .= 'padding-left:' . intval($value) . 'px;'; break; case 'paddingyvalue': $cssAsString .= 'padding-top:' . intval($value) . 'px;'; $cssAsString .= 'padding-bottom:' . intval($value) . 'px;'; break; case 'buttonbgcolor': $cssAsString .= 'background-color:' . sanitize_hex_color($value) . ';'; break; case 'buttontextcolor': $cssAsString .= 'color:' . sanitize_hex_color($value) . ';'; break; case 'buttontext': break; case 'buttontracking': $cssAsString .= 'letter-spacing:' . intval($value) . 'px;'; break; case 'buttonfontsize': $cssAsString .= 'font-size:' . intval($value) . 'px;'; break; case 'buttoncssclass': break; default: break; } } return $cssAsString; } return false; } /** * aavoya_araqch * This to create required html of button and popup form * @param string $inlineCss * @param string $cssClass * @param string $randomValueForJs * @param string $buttonText * @param int $contact7form * @return string $html */ public function aavoya_araqch($inlineCss = null, $cssClass = null, $randomValueForJs = null, $buttonText = null, $contact7form = null) { if ($inlineCss == null or $randomValueForJs == null or $buttonText == null or $contact7form == null) { return false; } $html = '
'; $html .= ''; return $html; } }