You appear to be a bot. Output may be restricted
Description
Create Yoast SEO dataSet fields specifically for Yoast SEO WordPress SEO aka YoastSEO has a number of fields which, if not set it goes away and attempts to determine from the content and excerpt. This is time consuming at front-end runtime so we need to set the values ourselves.
Usage
oiksc_yoastseo( $id, $name, $plugin, $type, $desc );
Parameters
- $id
- ( ID ) required –
- $name
- ( string ) required – the API, Class or Filename
- $plugin
- ( string ) required – component name: wordpress, plugin or theme
- $type
- ( string ) optional default: API – API, Class, File, Shortcode or shortcode parameter
- $desc
- ( string ) optional – short description
Returns
voidSource
File name: oik-shortcodes/admin/oik-yoastseo.phpLines:
1 to 9 of 9
function oiksc_yoastseo( $id, $name, $plugin, $type='API', $desc=null ) { if ( $plugin == "wordpress" ) { $plugin = "WordPress"; } $metadesc = "$name $desc $plugin $type"; $focuskw = "$name $plugin $type"; update_post_meta( $id, "_yoast_wpseo_metadesc", $metadesc ); update_post_meta( $id, "_yoast_wpseo_focuskw", $focuskw ); }View on GitHub