function generate_ryuzine_stylesheets() { // verify this came from the our screen and with proper authorization. if (!wp_verify_nonce($_POST['ryu_regenstyles_noncename'], 'ryuzine-regenstyles_install')) { return; } // Check permissions if (!current_user_can('administrator')) { echo "<div class='error'><p>Sorry, you do not have the correct priveledges to install the files.</p></div>"; return; } $my_query = null; $my_query = new WP_Query(array('post_type' => 'ryuzine')); if ($my_query->have_posts()) { while ($my_query->have_posts()) { $my_query->the_post(); $stylesheet = ""; $issuestyles = get_post_meta(get_the_ID(), '_ryustyles', false); if (!empty($issuestyles)) { foreach ($issuestyles as $appendstyle) { // If there are multiple ryustyles append them // $stylesheet = $stylesheet . $appendstyle; } } if ($stylesheet != "") { ryu_create_css($stylesheet, get_the_ID()); } } } // reset css check // // update_option('ryu_css_admin',0); wp_reset_query(); return; }
function save_issue_specific_data($post_id) { // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } // verify this came from the our screen and with proper authorization. if (isset($_POST['ryu_hello_noncename']) && !wp_verify_nonce($_POST['ryu_hello_noncename'], 'ryuzine' . $post_id) || isset($_POST['ryu_thank_noncename']) && !wp_verify_nonce($_POST['ryu_thank_noncename'], 'ryuzine' . $post_id) || isset($_POST['ryu_styles_noncename']) && !wp_verify_nonce($_POST['ryu_styles_noncename'], 'ryuzine' . $post_id) || isset($_POST['ryu_config_noncename']) && !wp_verify_nonce($_POST['ryu_config_noncename'], 'ryuzine' . $post_id)) { return $post_id; } // Check permissions if (!current_user_can('edit_post', $post_id)) { return $post_id; } // OK, we're authenticated: we need to find and save the data $post = get_post($post_id); if ($post->post_type == 'ryuzine') { if (isset($_POST['ryu_hello'])) { update_post_meta($post_id, '_ryuhello', $_POST['ryu_hello']); } if (isset($_POST['ryu_thank'])) { update_post_meta($post_id, '_ryuthank', $_POST['ryu_thank']); } if (isset($_POST['ryu_styles'])) { update_post_meta($post_id, '_ryustyles', $_POST['ryu_styles']); if ($_POST['ryu_styles'] != '' && $_POST['ryu_styles_overwrite'] == "1") { ryu_create_css($_POST['ryu_styles'], $post_id); } } if (isset($_POST['ryu_config_opt']) && $_POST['ryu_config_opt'] == '1') { $ryu_config = array('config' => '1', 'headerfooter' => $_POST['ryuzine_opt_covers_headerfooter'], 'autocover' => $_POST['ryuzine_opt_covers_autocover'], 'overlay' => $_POST['ryuzine_opt_covers_overlay'], 'use_cover' => $_POST['ryuzine_opt_covers_use_cover'], 'binding' => $_POST['ryuzine_opt_pages_binding'], 'pgsize' => $_POST['ryuzine_opt_pages_pgsize'], 'byline' => $_POST['ryuzine_opt_pages_byline'], 'postbody' => $_POST['ryuzine_opt_pages_postbody'], 'metadata' => $_POST['ryuzine_opt_pages_metadata'], 'comments' => $_POST['ryuzine_opt_pages_comments'], 'pgslider' => $_POST['ryuzine_opt_pages_pgslider'], 'natlang' => $_POST['ryuzine_opt_addons_natlang'], 'localization' => $_POST['ryuzine_opt_addons_localization'], 'language' => $_POST['ryuzine_opt_addons_language'], 'defaultTheme' => $_POST['ryuzine_opt_addons_defaultTheme'], 'swapThemes' => $_POST['ryuzine_opt_addons_swapThemes']); update_post_meta($post_id, '_ryuconfig', json_encode($ryu_config)); } else { // if use config is off, nuke custom config entry from db delete_post_meta($post_id, '_ryuconfig'); } // return(esc_attr($_POST['ryu_hello'])); } return $post_id; }