Plugin Directory

Changeset 2210952


Ignore:
Timestamp:
12/12/2019 04:29:34 PM (6 years ago)
Author:
b3none
Message:

Updated the-insertr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • the-insertr/trunk/the-insertr.php

    r2210699 r2210952  
    1212if (!defined('WPINC')) {
    1313    die('No direct access allowed');
     14}
     15
     16/**
     17 * If ACF is enabled add a listener to allow short codes
     18 */
     19if (!class_exists('ACF')) {
     20    add_filter('acf/format_value', 'my_acf_format_value');
     21
     22    function my_acf_format_value($value, $post_id, $field) {
     23        if (!is_array($value)) {
     24            $value = do_shortcode($value);
     25        }
     26
     27        return $value;
     28    }
     29}
     30
     31/**
     32 * If Yoast SEO is enabled make sure we can use short codes
     33 */
     34if (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')) {
     35    add_filter('wpseo_title', 'my_wpseo_title');
     36
     37    function my_wpseo_title($title) {
     38        return do_shortcode($title);
     39    }
    1440}
    1541
Note: See TracChangeset for help on using the changeset viewer.