function scrgen_head() { $strategy = scrgen_setting('social_strategy'); if ($strategy == '') { return; } $thumbnail_id = get_post_thumbnail_id(); if ($strategy == 'always' || $strategy == 'missing' && empty($thumbnail_id)) { scrgen_opengraph(); scrgen_twitter(); } }
function scrgen_social_strategy_render() { ?> <label> <input type='radio' name='scrgen_social_strategy' <?php checked(scrgen_setting('social_strategy'), 'missing'); ?> value='missing'> Add screenshots for social media when no featured image is available. </label> <br /> <label> <input type='radio' name='scrgen_social_strategy' <?php checked(scrgen_setting('social_strategy'), 'always'); ?> value='always'> Always add screenshots for social media. </label> <br /> <label> <input type='radio' name='scrgen_social_strategy' <?php checked(scrgen_setting('social_strategy'), ''); ?> value=''> Never add screenshots for social media. </label> <?php }