ID, "wps_hide_caw", true); } function wps_get_the_subtitle(){ global $post; echo get_post_meta($post->ID, "wps_subtitle", true); } function wps_get_the_image_gallery_subtitle(){ global $post; echo get_post_meta($post->ID, "wps_image_gallery_subtitle", true); } function wps_get_the_featured_story(){ global $post; echo get_post_meta($post->ID, "wps_featured_story", true); } function wps_get_the_image_url(){ global $post; echo get_post_meta($post->ID, "wps_image_url", true); } // *********************************** include CSS for hidden panel **************************** function wps_add_panel_css(){ $css = WP_PLUGIN_URL . '/wp-custom-options/admin/css/panel.css'; wp_register_style('wps_css', $css); wp_enqueue_style( 'wps_css'); } // ************************************* display xhtml for hidden panel ************************ function wps_add_panel_XHTML(){ if( function_exists( 'add_meta_box' )) { add_meta_box('wps_panel', 'Page/Post Custom Options', 'wps_show_hide_panel', 'page', 'normal', 'high'); add_meta_box('wps_panel', 'Page/Post Custon Options', 'wps_show_post_hide_panel', 'post', 'normal', 'high'); } else { add_action('dbx_page_advanced', 'wps_show_hide_panel_old'); add_action('dbx_post_advanced', 'wps_show_hide_panel_old'); add_action('dbx_page_advanced', 'wps_show_subtitle_panel_old'); add_action('dbx_post_advanced', 'wps_show_subtitle_panel_old'); } //include css if admin if(is_admin()){ add_action('admin_print_styles', 'wps_add_panel_css'); } } // ********************************** include XHTML for form inside panel ************************* function wps_show_hide_panel(){ include ABSPATH . PLUGINDIR . "/wp-custom-options/admin/panel.inc.php"; } function wps_show_post_hide_panel(){ include ABSPATH . PLUGINDIR . "/wp-custom-options/admin/post_panel.inc.php"; } // ****************************** for pre-2.5, include shell for panel ***************************** function wps_show_hide_panel_old(){ include ABSPATH . PLUGINDIR . "/wp-custom-options/admin/compat_panel.inc.php"; } // ************************ store hidden content in db as custom field ************************* function wps_save_hide_caw($post_id){ $hidden_caw = "false"; if(isset($_POST['wps_hide_caw'])){ $hidden_caw = "true"; } if(!wp_verify_nonce($_POST['wps_caw_noncename'], 'wps_hide_caw')){ return $post_id; } if('page'==$_POST['post_type']){ if(!current_user_can('edit_page', $post_id)){ return $post_id; } } else { if(!current_user_can('edit_post', $post_id)){ return $post_id; } } //save data if(!update_post_meta($post_id, "wps_hide_caw", $hidden_caw)){ add_post_meta($post_id, "wps_hide_caw", $hidden_caw); } } function wps_save_subtitle($post_id){ //verify if (!wp_verify_nonce( $_POST['wps_noncename'], 'wp_subtitle')) { return $post_id; } if ('page' == $_POST['post_type']){ if (!current_user_can('edit_page', $post_id)){ return $post_id; } } else { if (!current_user_can('edit_post', $post_id)){ return $post_id; } } //save data if(!update_post_meta($post_id, "wps_subtitle", $_POST["wps_subtitle"])){ add_post_meta($post_id, "wps_subtitle", $_POST["wps_subtitle"]); } } function wps_save_image_gallery_subtitle($post_id){ // For the image gallery subtitle if (!wp_verify_nonce( $_POST['wps_noncename_image_gallery'], 'wp_subtitle_image_gallery')) { return $post_id; } if ('page' == $_POST['post_type']){ if (!current_user_can('edit_page', $post_id)){ return $post_id; } } else { if (!current_user_can('edit_post', $post_id)){ return $post_id; } } //save data if(!update_post_meta($post_id, "wps_image_gallery_subtitle", $_POST["wps_image_gallery_subtitle"])){ add_post_meta($post_id, "wps_image_gallery_subtitle", $_POST["wps_image_gallery_subtitle"]); } } function wps_save_featured_story($post_id){ //save data if(!wp_verify_nonce($_POST['wps_noncename_featured_story'], 'wp_featured_story')){ return $post_id; } if ('page' == $_POST['post_type']){ if (!current_user_can('edit_page', $post_id)){ return $post_id; } } else { if (!current_user_can('edit_post', $post_id)){ return $post_id; } } if(!update_post_meta($post_id, "wps_featured_story", $_POST["wps_featured_story_input"])){ add_post_meta($post_id, "wps_featured_story", $_POST["wps_featured_story_input"]); } } function wps_save_image_url($post_id){ if (!wp_verify_nonce( $_POST['wps_noncename_image_url'], 'wp_image_url')) { return $post_id; } if ('page' == $_POST['post_type']){ if (!current_user_can('edit_page', $post_id)){ return $post_id; } } else { if (!current_user_can('edit_post', $post_id)){ return $post_id; } } if(!update_post_meta($post_id, "wps_image_url", $_POST["upload_image"])){ add_post_meta($post_id, "wps_image_url", $_POST["upload_image"]); } } // ****************************** return values from post inside The Loop ********************** function hidden_caw($before="", $after="", $display=true){ global $post; $hide_caw = $before . get_post_meta($post->ID, "wps_hide_caw", true) . $after; return $hide_caw; } function the_subtitle($before="", $after="", $display=true){ global $post; $subtitle = $before . get_post_meta($post->ID, "wps_subtitle", true) . $after; if($display){ echo $subtitle; } else { return $subtitle; } } function the_image_gallery_subtitle($before="", $after="", $display=true){ global $post; $image_gallery_subtitle = $before . get_post_meta($post->ID, "wps_image_gallery_subtitle", true) . $after; if($display){ echo $image_gallery_subtitle; } else { return $image_gallery_subtitle; } } function the_featured_story($before="", $after="", $display=true){ global $post; $featured_story = $before . get_post_meta($post->ID, "wps_featured_story", true) . $after; if($display){ echo $featured_story; } else { return $featured_story; } } function the_image_url($before="", $after="", $display=true){ global $post; $image_url = $before . get_post_meta($post->ID, "wps_image_url", true) . $after; if($display){ echo $image_url; } else { return $image_url; } } // ************ return (or display) variables from post with ID passed as argument **************** function get_the_hide_caw($id, $before="", $after="", $display=true){ $hide_caw = $before . get_post_meta($id, "wps_hide_caw", true) . $after; return $hide_caw; } function get_the_subtitle($id, $before="", $after="", $display=true){ $subtitle = $before . get_post_meta($id, "wps_subtitle", true) . $after; if($display){ echo $subtitle; } else { return $subtitle; } } function get_the_image_gallery_subtitle($id, $before="", $after="", $display=true){ $image_gallery_subtitle = $before . get_post_meta($id, "wps_image_gallery_subtitle", true) . $after; if($display){ echo $image_gallery_subtitle; } else { return $image_gallery_subtitle; } } function get_the_featured_story($id, $before="", $after="", $display=true){ $featured_story = $before . get_post_meta($id, "wps_featured_story", true) . $after; if($display){ echo $featured_story; } else { return $featured_story; } } function get_the_image_url($id, $before="", $after="", $display=true){ $image_url = $before . get_post_meta($id, "wps_image_url", true) . $after; if($display){ echo $image_url; } else { return $image_url; } } ?> Fall 2017 Newsletter | Four Seasons Hotel Austin
 

Fall 2017 Newsletter