Beispiel #1
0
/**
 * Turn on actions after running code during pods_conflict
 *
 * @param string $object_type
 *
 * @return bool
 *
 * @since 2.0
 */
function pods_no_conflict_off($object_type = 'post')
{
    if ('post_type' == $object_type) {
        $object_type = 'post';
    } elseif ('term' == $object_type) {
        $object_type = 'taxonomy';
    }
    if (!class_exists('PodsInit')) {
        pods_init();
    }
    if (empty(PodsInit::$no_conflict) || !isset(PodsInit::$no_conflict[$object_type]) || empty(PodsInit::$no_conflict[$object_type])) {
        return false;
    }
    if (!is_object(PodsInit::$meta)) {
        return false;
    }
    $no_conflict = PodsInit::$no_conflict[$object_type];
    $conflicted = false;
    foreach ($no_conflict as $action_filter => $conflicts) {
        foreach ($conflicts as $args) {
            if (!call_user_func_array('has_' . $action_filter, array_slice($args, 0, 2))) {
                call_user_func_array('add_' . $action_filter, $args);
                $conflicted = true;
            }
        }
    }
    if ($conflicted) {
        unset(PodsInit::$no_conflict[$object_type]);
        return true;
    }
    return false;
}
Beispiel #2
0
    } else {
        global $pods, $pods_init, $pods_form;
        require_once PODS_DIR . 'includes/classes.php';
        require_once PODS_DIR . 'includes/data.php';
        require_once PODS_DIR . 'includes/general.php';
        if (!defined('PODS_MEDIA') || PODS_MEDIA) {
            require_once PODS_DIR . 'includes/media.php';
        }
        if (!defined('SHORTINIT') || !SHORTINIT) {
            if (pods_allow_deprecated()) {
                require_once PODS_DIR . 'deprecated/deprecated.php';
            }
            if (false !== pods_compatibility_check()) {
                $pods_form = pods_form();
                if (!is_network_admin()) {
                    $pods_init = pods_init();
                }
            }
        }
    }
}
/**
 * Deactivate Pods 1.x or other Pods plugins
 */
function pods_deactivate_pods_1_x()
{
    if (defined('PODS_VERSION') && defined('PODS_DIR') && file_exists(untrailingslashit(PODS_DIR) . '/init.php')) {
        if (!function_exists('deactivate_plugins')) {
            include_once ABSPATH . 'wp-admin/includes/plugin.php';
        }
        deactivate_plugins(realpath(untrailingslashit(PODS_DIR) . '/init.php'));