Skip to main content

GravityView_Social_Meta

Integrate with the WordPress SEO plugin

Since: 1.0

Source: includes/class-gravityview-social-meta.php:8

Details

  • Kind: class
  • Namespace: (global)

Properties

PropertyTypeDescription
$_min_wpseo_versionstringMinimum WordPress SEO version

Methods

MethodDescription
get_instance()
add_hooks()Add Frontend and Admin hooks
admin_view_hooks()Add admin hooks
override_gv_tab_style_and_behavior()Set custom style/JS for the GravityView tab
add_gv_tab()Add a GravityView tab with field settings to the Yoast metabox
save_metaboxes()Saves our meta fields when saving Yoast meta
modify_metabox_fields()Copy each setting in the WordPress SEO metabox so there's also a setting for Single Entry context
frontend_view_hooks()Add filters for the WordPress SEO metadata
jetpack_opengraph_filter()Filter the OpenGraph data generated by Jetpack
maybe_fix_yoast_single_entry_og_image()Fix for Yoast 14.7 not firing wpseo_opengraph_image filter unless the OG (https://github.com/Yoast/wordpress-seo/issues/15721)
process_merge_tags()Replace merge tags in the WordPress SEO settings
multiple_entries_filter_meta_value()Process shortcodes so that [gvlogic] can run for context detection
single_entry_filter_meta_value()

Method Reference

get_instance()

static function get_instance()

Returns

Source: includes/class-gravityview-social-meta.php:32

add_hooks()

public function add_hooks()

Add Frontend and Admin hooks

Returns

  • void

Since: 1.0

Source: includes/class-gravityview-social-meta.php:48

admin_view_hooks()

public function admin_view_hooks()

Add admin hooks

Returns

  • void

Source: includes/class-gravityview-social-meta.php:60

override_gv_tab_style_and_behavior()

public function override_gv_tab_style_and_behavior()

Set custom style/JS for the GravityView tab

Returns

  • void

Source: includes/class-gravityview-social-meta.php:73

add_gv_tab()

public function add_gv_tab( $tabs_data )

Add a GravityView tab with field settings to the Yoast metabox

Parameters

NameTypeDefaultDescription
$tabs_dataarrayMetabox tabs data

Returns

  • array — $tabs_data Modified metabox abs data

Since: 2.0

Source: includes/class-gravityview-social-meta.php:123

save_metaboxes()

public function save_metaboxes( $metaboxes=[] )

Saves our meta fields when saving Yoast meta

Parameters

NameTypeDefaultDescription
$metaboxesarray[]Existing metaboxes to render

Returns

  • array

Since: 2.0

Source: includes/class-gravityview-social-meta.php:166

modify_metabox_fields()

public function modify_metabox_fields( $field_defs, $post_type='' )

Copy each setting in the WordPress SEO metabox so there's also a setting for Single Entry context

Adds merge tags to Single Entry settings

Parameters

NameTypeDefaultDescription
$field_defsarrayField settings
$post_typestring''Post type - inaccurate; we check it ourselves

Returns

  • array — Modified $field_defs, if gravityview post type

Source: includes/class-gravityview-social-meta.php:275

frontend_view_hooks()

public function frontend_view_hooks()

Add filters for the WordPress SEO metadata

Source: includes/class-gravityview-social-meta.php:298

jetpack_opengraph_filter()

public function jetpack_opengraph_filter( $tags=[], $image_sizes=[] )

Filter the OpenGraph data generated by Jetpack

Parameters

NameTypeDefaultDescription
$tagsarray[]
$image_sizesarray[]

Returns

  • array

Source: includes/class-gravityview-social-meta.php:319

maybe_fix_yoast_single_entry_og_image()

public function maybe_fix_yoast_single_entry_og_image( $image_class_instance )

Fix for Yoast 14.7 not firing wpseo_opengraph_image filter unless the OG (https://github.com/Yoast/wordpress-seo/issues/15721)

Parameters

NameTypeDefaultDescription
$image_class_instance

Returns

  • void

Since: 3.0

Source: includes/class-gravityview-social-meta.php:366

process_merge_tags()

public function process_merge_tags( $value )

Replace merge tags in the WordPress SEO settings

Parameters

NameTypeDefaultDescription
$valuestring

Returns

  • string

Source: includes/class-gravityview-social-meta.php:393

multiple_entries_filter_meta_value()

public function multiple_entries_filter_meta_value( $value )

Process shortcodes so that [gvlogic] can run for context detection

Parameters

NameTypeDefaultDescription
$valuestring

Returns

  • string

Since: 2.0

Source: includes/class-gravityview-social-meta.php:474

single_entry_filter_meta_value()

public function single_entry_filter_meta_value( $value )

Parameters

NameTypeDefaultDescription
$valuestringExisting value for the

Returns

  • string

Since: 2.0 (Added do_shortcode())

Source: includes/class-gravityview-social-meta.php:486