/** * Save custom CSS information: files, code * @return void */ function save_css_custom() { if (!isset($_POST[WR_MEGAMENU_NONCE]) || !wp_verify_nonce($_POST[WR_MEGAMENU_NONCE], WR_MEGAMENU_NONCE)) { return; } $post_id = esc_sql($_POST['post_id']); // save custom css code & files WR_Megamenu_Helpers_Functions::custom_css($post_id, 'css_files', 'put', esc_sql($_POST['css_files'])); WR_Megamenu_Helpers_Functions::custom_css($post_id, 'css_custom', 'put', esc_textarea($_POST['custom_css'])); exit; }
/** * Get custom css data: Css files, Css code of a post * * @global type $post * @param type $post_id * @return type */ static function custom_css_data($post_id) { global $post; $arr = array('css_files' => '', 'css_custom' => ''); if (isset($post_id)) { $arr['css_files'] = WR_Megamenu_Helpers_Functions::custom_css($post_id, 'css_files'); $arr['css_custom'] = WR_Megamenu_Helpers_Functions::custom_css($post_id, 'css_custom'); } return $arr; }