Skip to content

Instantly share code, notes, and snippets.

@Codevz
Last active June 18, 2022 10:36
Show Gist options
  • Save Codevz/5d7b9654203923925be715510a961ffb to your computer and use it in GitHub Desktop.
Save Codevz/5d7b9654203923925be715510a961ffb to your computer and use it in GitHub Desktop.
XTRA WP Theme modify a page meta option value via custom WordPress filter, https://xtratheme.com/
<?php
/**
* With this function you can modify any options value for specific page or post.
*
* @var $meta saved page/post settings
* @var $post_id current page/post ID
*
* @return array
*/
function codevz_page_meta( $meta, $post_id ) {
// On specific page only.
if ( $post_id === '21' ) {
$meta[ 'layout' ] = 'left';
}
return $meta;
}
add_filter( 'codevz/page/meta', 'codevz_page_meta', 10, 2 );
@Codevz
Copy link
Author

Codevz commented Jan 11, 2022

If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment