GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
class-gravityview-plugin-hooks-yoast-seo.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Add Yoast SEO scripts and styles to GravityView no-conflict list
4  *
5  * @file class-gravityview-plugin-hooks-yoast-seo.php
6  * @package GravityView
7  * @license GPL2+
8  * @author Katz Web Services, Inc.
9  * @link http://gravityview.co
10  * @copyright Copyright 2015, Katz Web Services, Inc.
11  *
12  * @since 1.15.2
13  */
14 
15 /**
16  * @inheritDoc
17  * @since 1.15.2
18  */
20 
21  /**
22  * @inheritDoc
23  * @since 1.15.2
24  */
25  protected $constant_name = 'WPSEO_FILE';
26 
27  /**
28  * @inheritDoc
29  * @since 1.15.2
30  */
31  protected $style_handles = array(
32  'wp-seo-metabox',
33  'wpseo-admin-media',
34  'metabox-tabs',
35  'metabox-classic',
36  'metabox-fresh',
37  );
38 
39  /**
40  * @inheritDoc
41  * @since 1.15.2
42  */
43  protected $script_handles = array(
44  'wp-seo-metabox',
45  'wpseo-admin-media',
46  'jquery-qtip',
47  'jquery-ui-autocomplete',
48  );
49 
50  /**
51  * @inheritDoc
52  * @copydoc GravityView_Plugin_and_Theme_Hooks::add_hooks()
53  * @since 1.15.2
54  */
55  protected function add_hooks() {
56 
57  parent::add_hooks();
58 
60 
61  // Make Yoast metabox go down to the bottom please.
62  add_filter( 'wpseo_metabox_prio', array( $this, '__return_low' ) );
63 
64  // Prevent the SEO from being checked. Eesh.
65  add_filter( 'wpseo_use_page_analysis', '__return_false' );
66 
67  // WordPress SEO Plugin
68  add_filter( 'option_wpseo_titles', array( $this, 'hide_wordpress_seo_metabox' ) );
69  }
70  }
71 
72  /**
73  * Modify the WordPress SEO plugin's metabox behavior
74  *
75  * Only show when the View has been configured.
76  *
77  * @since 1.15.2 Moved from class-gravityview-admin-metaboxes.php
78  *
79  * @param array $options WP SEO options array
80  * @return array Modified array if on post-new.php
81  */
82  function hide_wordpress_seo_metabox( $options = array() ) {
83  global $pagenow;
84 
85  // New View page
86  if( $pagenow === 'post-new.php' ) {
87  $options['hideeditbox-gravityview'] = true;
88  }
89 
90  return $options;
91  }
92 
93  /**
94  * Return 'low' as the status for metabox priority when on a GravityView post type admin screen
95  *
96  * @since 1.15.2 Moved from class-gravityview-admin-metaboxes.php
97  * @since 1.15.2 Added check for GravityView post type
98  *
99  * @param string $existing Existing priority. Default: `high`
100  * @return string Returns 'low'
101  */
102  function __return_low( $existing = 'high' ) {
103  return 'low';
104  }
105 }
106 
hide_wordpress_seo_metabox($options=array())
Modify the WordPress SEO plugin&#39;s metabox behavior.
gravityview_is_admin_page($hook= '', $page=NULL)
Alias for GravityView_Admin::is_admin_page()
__return_low($existing= 'high')
Return &#39;low&#39; as the status for metabox priority when on a GravityView post type admin screen...
Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles...