@charset "UTF-8";
/*
    Template: swell
    Theme Name: SWELL CHILD
    Theme URI: https://swell-theme.com/
    Description: SWELLの子テーマ
    Version: 1.0.0
    Author: LOOS WEB STUDIO
    Author URI: https://loos-web-studio.com/

    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/
add_filter( 'ssp_output_title', function( $ssp_title ) {

    $post_id  = get_the_ID();
    $cocoon_meta_atnak = get_post_meta( $post_id, 'the_page_seo_title', true );
    $ssp_meta = get_post_meta( $post_id, 'ssp_meta_title', true );
    if ( empty( $ssp_meta ) && $cocoon_meta_atnak ) {
        return $cocoon_meta_atnak;
    }
    return $ssp_title;
});
add_filter('ssp_output_description', function($ssp_description) {

    $cocoon_meta_atnak = get_post_meta(get_the_ID(), 'the_page_meta_description', true);
    $ssp_meta = get_post_meta(get_the_ID(), 'ssp_meta_description', true);
    if ( empty( $ssp_meta ) && $cocoon_meta_atnak ) {
        return $cocoon_meta_atnak;
    }
    return $ssp_description;

});
add_filter('ssp_output_canonical', function($canonical) {

    $cocoon_meta_atnak = get_post_meta(get_the_ID(), 'the_page_canonical_url', true);
    $ssp_meta = get_post_meta(get_the_ID(), 'ssp_meta_canonical', true);
    if ( empty( $ssp_meta ) && $cocoon_meta_atnak ) {
        return $cocoon_meta_atnak;
    }
    return $ssp_output_canonical;

});
