1set_textdomain( 'etch-theme' );2526 // add the pre-built license settings page.27 $client->settings()->add_page(28 array(29 'type' => 'submenu', // Can be: menu, options, submenu.30 'parent_slug' => 'etch', // add your plugin menu slug.31 'page_title' => 'Etch Theme',32 'menu_title' => 'Etch Theme',33 'capability' => 'manage_options',
/* Sedistone page SEO and featured-image configuration. */
add_action(
'init',
function () {
if ( get_option( 'sedistone_seo_seeded_v1' ) ) {
return;
}
$pages = array(
2 => array(
'title' => 'Sedistone | Mortarless Stone Cladding',
'description' => 'Discover Sedistone, mortarless stone cladding with stainless-steel fastening, built-in drainage and ventilation, and nationwide availability.',
'image' => 75,
),
14 => array(
'title' => 'Why Sedistone | Mortarless Stone Cladding System',
'description' => 'See how Sedistone combines authentic stone character with mechanical fastening, drainage, ventilation, faster installation, and lasting performance.',
'image' => 76,
),
16 => array(
'title' => 'Sedistone Installation | Mortarless Stone Guide',
'description' => 'Learn how to install Sedistone with wall preparation, flashing, starter-strip, fastening, cutting, safety, and finishing guidance.',
'image' => 78,
),
18 => array(
'title' => 'Sedistone Gallery | Stone Cladding Projects',
'description' => 'Explore Sedistone project photos featuring exterior walls, corners, wainscoting, outdoor living spaces, fireplaces, and interior focal points.',
'image' => 77,
),
20 => array(
'title' => 'Sedistone Resources | Installation & Product Guides',
'description' => 'Access Sedistone installation instructions, video guidance, product fundamentals, and project resources for homeowners and building professionals.',
'image' => 79,
),
22 => array(
'title' => 'Request a Sedistone Quote | Nationwide Stone Cladding',
'description' => 'Request a Sedistone quote for your residential or commercial stone cladding project. Product and project support is available nationwide.',
'image' => 80,
),
64 => array(
'title' => 'Privacy Policy | Sedistone',
'description' => 'Read the Sedistone Privacy Policy to understand how information is collected, used, protected, retained, and disclosed when you use our website.',
'image' => 73,
),
);
foreach ( $pages as $page_id => $settings ) {
wp_update_post(
array(
'ID' => $page_id,
'post_excerpt' => $settings['description'],
)
);
update_post_meta( $page_id, '_sedistone_seo_title', $settings['title'] );
update_post_meta( $page_id, '_sedistone_meta_description', $settings['description'] );
set_post_thumbnail( $page_id, $settings['image'] );
}
update_option( 'sedistone_seo_seeded_v1', 1, false );
}
);
add_filter(
'pre_get_document_title',
function ( $title ) {
if ( ! is_page() ) {
return $title;
}
$seo_title = get_post_meta( get_queried_object_id(), '_sedistone_seo_title', true );
return $seo_title ? $seo_title : $title;
}
);
add_action(
'wp_head',
function () {
if ( ! is_page() ) {
return;
}
$page_id = get_queried_object_id();
$title = get_post_meta( $page_id, '_sedistone_seo_title', true );
$description = get_post_meta( $page_id, '_sedistone_meta_description', true );
$image = get_the_post_thumbnail_url( $page_id, 'large' );
$url = get_permalink( $page_id );
if ( ! $description ) {
return;
}
echo "\n" . '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
if ( $image ) {
echo '' . "\n";
}
echo '' . "\n";
echo '' . "\n";
echo '' . "\n";
}
);