Ejemplo n.º 1
0
 public function save_post_override_fields($post_id)
 {
     if (!isset($_POST['post_override_fields_nonce'])) {
         return;
     }
     if (!wp_verify_nonce($_POST['post_override_fields_nonce'], 'save_post_override_fields')) {
         return;
     }
     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
         return;
     }
     if (isset($_POST['post_type']) && 'page' == $_POST['post_type']) {
         if (!current_user_can('edit_page', $post_id)) {
             return;
         }
     } else {
         if (!current_user_can('edit_post', $post_id)) {
             return;
         }
     }
     if (!isset($_POST['post_title_override']) || !isset($_POST['post_description_override'])) {
         return;
     }
     $title_override = $_POST['post_title_override'];
     $description_override = $_POST['post_description_override'];
     update_post_meta($post_id, $this->plugin->get_option_prefix() . 'post_title_override', $title_override);
     update_post_meta($post_id, $this->plugin->get_option_prefix() . 'post_description_override', $description_override);
 }
 /**
  * Returns the site description set in the options, returns false if the site description is not set
  *
  * @return  bool|string  The site description, or false if not set
  */
 private function get_site_description()
 {
     return $this->plugin->get_plugin_option('site_description');
 }
Ejemplo n.º 3
0
/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * @since    1.0.0
 */
function run_aot()
{
    $aot_plugin = new AOT();
    $aot_plugin->run();
}