Example #1
0
/**
 * Main init hook.
 */
function wpcf_embedded_init()
{
    $locale = get_locale();
    load_textdomain('wpcf', WPCF_EMBEDDED_ABSPATH . '/locale/types-' . $locale . '.mo');
    if (!defined('WPV_VERSION')) {
        load_textdomain('wpv-views', WPCF_EMBEDDED_ABSPATH . '/locale/locale-views/views-' . $locale . '.mo');
    }
    // Define necessary constants if plugin is not present
    if (!defined('WPCF_VERSION')) {
        define('WPCF_VERSION', '1.0.4');
        define('WPCF_META_PREFIX', 'wpcf-');
        define('WPCF_EMBEDDED_RELPATH', icl_get_file_relpath(__FILE__));
    } else {
        define('WPCF_EMBEDDED_RELPATH', WPCF_RELPATH . '/embedded');
    }
    define('WPCF_EMBEDDED_INC_RELPATH', WPCF_EMBEDDED_RELPATH . '/includes');
    define('WPCF_EMBEDDED_RES_RELPATH', WPCF_EMBEDDED_RELPATH . '/resources');
    if (is_admin()) {
        require_once WPCF_EMBEDDED_ABSPATH . '/admin.php';
        wpcf_embedded_admin_init_hook();
    } else {
        require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php';
    }
    wpcf_init_custom_types_taxonomies();
    if (defined('DOING_AJAX')) {
        require_once WPCF_EMBEDDED_ABSPATH . '/frontend.php';
    }
    wpcf_embedded_check_import();
}
 /**
  * Set global variables & check version
  * 
  * @param array $pluginInfo array of plugin information
  * @param array $pluginDefaultOptions array of plugin default options
  */
 function Initialize($pluginInfo, $pluginDefaultOptions)
 {
     // Set global variable
     $this->g_info = $pluginInfo;
     // Check WP version and display warning if not compatible
     $this->WarningIfPluginNotCompatible();
     // Initialize the base64 icons
     $this->IniBase64Icons();
     // Plugin default options
     $this->g_opt_default = $pluginDefaultOptions;
     // Initialize plugin options
     $this->IniOrUpdateOptions();
     // Language file
     // Doesn't work properly prior to WP2.7; Let's make it like in plugin 'Google Sitemap', thanks to Arne Brachhold :-)
     global $wp_version;
     if (version_compare($wp_version, '2.7', '>=')) {
         // >= WordPress 2.7
         load_plugin_textdomain($this->g_info['ShortName'], false, trailingslashit(dirname($this->GetPluginBasename())) . 'languages');
     } else {
         // < WordPress 2.7
         $currentLocale = get_locale();
         if (!empty($currentLocale)) {
             $moFile = dirname($this->g_info['PluginFile']) . '/languages/' . $this->g_info['ShortName'] . '-' . $currentLocale . '.mo';
             if (@file_exists($moFile) && is_readable($moFile)) {
                 load_textdomain($this->g_info['ShortName'], $moFile);
             }
         }
     }
     // Register plugin options page
     if (method_exists($this, 'PluginOptionsPage')) {
         $this->RegisterPluginOptionsPage();
     }
 }
 /**
  * Load textdomain
  */
 function load_textdomain()
 {
     $domain = 'wp_jwt_auth';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, WP_LANG_DIR . '/wp-jwt-authentication/' . $domain . '-' . $locale . '.mo');
     load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/languages/');
 }
 /**
  * Internationalization setup
  *
  * @return void
  */
 public function i18n()
 {
     $domain = 'better-blockquotes';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, WP_LANG_DIR . "/tinymce-email-button/{$domain}-{$locale}.mo");
     load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/languages/');
 }
/**
 * Default initialization for the plugin:
 * - Registers the default textdomain.
 */
function machouinard_adds_init()
{
    $locale = apply_filters('plugin_locale', get_locale(), 'machouinard_adds');
    load_textdomain('machouinard_adds', WP_LANG_DIR . '/machouinard_adds/machouinard_adds-' . $locale . '.mo');
    load_plugin_textdomain('machouinard_adds', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    // add_action( 'admin_menu', 'machouinard_adds_admin_settings' );
}
 public function load_plugin_textdomain()
 {
     $domain = 'ut_portfolio_lang';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
     load_plugin_textdomain($domain, FALSE, dirname(plugin_basename($this->file)) . '/lang/');
 }
Example #7
0
 public function plugin_textdomain()
 {
     $domain = 'pixcodes_txtd';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
     load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/lang/');
 }
 /**
  * Load the plugin text domain for translation.
  */
 public function load_plugin_textdomain()
 {
     $domain = 'lrw-so-widgets-bundle';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, trailingslashit(WP_LANG_DIR) . 'lrw-so-widgets-bundle/lrw-so-widgets-bundle-' . $locale . '.mo');
     load_plugin_textdomain('lrw-so-widgets-bundle', false, dirname(plugin_basename(__FILE__)) . '/languages/');
 }
Example #9
0
function saml_load_translations()
{
    $domain = 'onelogin-saml-sso';
    $mo_file = plugin_dir_path(dirname(__FILE__)) . 'lang/' . get_locale() . '/' . $domain . '.mo';
    load_textdomain($domain, $mo_file);
    load_plugin_textdomain($domain, false, dirname(plugin_basename(__FILE__)) . '/lang/' . get_locale() . '/');
}
 public function load_plugin_textdomain()
 {
     $locale = apply_filters('plugin_locale', get_locale(), 'wpdance');
     $mofile = WP_PLUGIN_DIR . '/' . plugin_basename(dirname(__FILE__)) . '/lang/' . $this->plugin_domain . '-' . $locale . '.mo';
     load_textdomain($this->plugin_domain, $mofile);
     load_plugin_textdomain('wpdance', false, plugin_basename(dirname(__FILE__)) . "/lang");
 }
Example #11
0
 public function addLanguage($data)
 {
     load_textdomain('bbcode-toolbar', dirname(__FILE__) . '/lang/' . $this->feather->user->language . '/bbeditor.mo');
     $lang_bbeditor = array('btnBold' => __('btnBold', 'bbcode-toolbar'), 'btnItalic' => __('btnItalic', 'bbcode-toolbar'), 'btnUnderline' => __('btnUnderline', 'bbcode-toolbar'), 'btnColor' => __('btnColor', 'bbcode-toolbar'), 'btnLeft' => __('btnLeft', 'bbcode-toolbar'), 'btnRight' => __('btnRight', 'bbcode-toolbar'), 'btnJustify' => __('btnJustify', 'bbcode-toolbar'), 'btnCenter' => __('btnCenter', 'bbcode-toolbar'), 'btnLink' => __('btnLink', 'bbcode-toolbar'), 'btnPicture' => __('btnPicture', 'bbcode-toolbar'), 'btnList' => __('btnList', 'bbcode-toolbar'), 'btnQuote' => __('btnQuote', 'bbcode-toolbar'), 'btnCode' => __('btnCode', 'bbcode-toolbar'), 'promptImage' => __('promptImage', 'bbcode-toolbar'), 'promptUrl' => __('promptUrl', 'bbcode-toolbar'), 'promptQuote' => __('promptQuote', 'bbcode-toolbar'));
     $data['jsVars']['bbcodeToolbar'] = json_encode($lang_bbeditor);
     return $data;
 }
Example #12
0
 public function __construct($args = array())
 {
     // Load our helper function
     require_once 'icit-helpers.php';
     // notification helper
     require_once 'icit-notices.php';
     // Makes it easier to set default options on get_option.
     require_once 'icit-defaults.php';
     if (isset($args['dir'])) {
         $this->dir = $args['dir'];
     }
     if (isset($args['url'])) {
         $this->url = $args['url'];
     }
     // Set the folder for the core
     $this->dir === null && ($this->dir = dirname(__FILE__));
     // Load the translation stuff..
     $locale = get_locale();
     if (file_exists($this->dir . '/lang/' . self::DOM . '-' . $locale . '.mo')) {
         load_textdomain(self::DOM, $this->dir . '/lang/' . self::DOM . '-' . $locale . '.mo');
     }
     // add core class autoloaders
     spl_autoload_register(array($this, '__autoload'));
     //spl_autoload_register( array( $this, '__autoload_psr0' ) );
     spl_autoload_register(array($this, '__autoload_wp'));
     if (did_action('init') && !(isset($_GET['action']) && $_GET['action'] == 'activate' && isset($_GET['plugin']))) {
         _doing_it_wrong('icit_core', __('icit_core should be included at the top of your theme or plug-in file and should load before the init action.', self::DOM), 'icit_core:1.0');
     } else {
         if (!did_action('plugins_loaded') && !did_action('setup_theme') && $this->is_plugin == null) {
             $this->is_plugin = true;
         } elseif (did_action('plugins_loaded') && !did_action('setup_theme') && $this->is_plugin === null) {
             $this->is_plugin = false;
         }
     }
 }
function dtheme_startup()
{
    global $dt_revealData, $krypton_Scripts, $krypton_config;
    $dt_revealData = array();
    $krypton_Scripts = array();
    $theme_name = get_template();
    $locale = get_locale();
    $localelanguage = get_template_directory() . '/languages';
    if (is_child_theme() && !load_textdomain('Krypton', untrailingslashit(get_stylesheet_directory()) . "/{$locale}.mo") || !is_child_theme() && !load_theme_textdomain('Krypton', get_template_directory())) {
        $aaa = load_theme_textdomain('Krypton', $localelanguage);
    }
    // Add post thumbnail supports. http://codex.wordpress.org/Post_Thumbnails
    add_theme_support('post-thumbnails');
    add_theme_support('automatic-feed-links');
    add_theme_support('menus');
    add_theme_support('woocommerce');
    add_theme_support('title-tag');
    register_nav_menus(array('primary' => __('Top Navigation', 'Krypton'), 'footer_navigation' => __('Footer Navigation', 'Krypton')));
    // sidebar widget
    register_sidebar(array('name' => 'Sidebar', 'id' => 'krypton-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Bottom Widget', 'id' => 'krypton-bottom', 'description' => __('Bottom Widget Area. Recomended 3 widgets', 'Krypton'), 'before_widget' => '<div class="col-lg-4 col-md-4 col-sm-4 clearfix"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<div class="row"><div class="section-head"><header class="col col-sm-12 centered"><h2>', 'after_title' => '</h2><hr></header></div></div>'));
    register_sidebar(array('name' => 'Contact Page Sidebar', 'id' => 'krypton-contact-sidebar', 'description' => __('Widget area for contact page', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>'));
    if (is_plugin_active('woocommerce/woocommerce.php')) {
        register_sidebar(array('name' => 'Shop Sidebar', 'id' => 'shop-sidebar', 'description' => __('Sidebar Widget Area', 'Krypton'), 'before_widget' => '<div class="widget %s %s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
        register_sidebar(array('name' => 'Shop Bottom ', 'id' => 'shop-bottom', 'description' => __('Shop Bottom Widget Area. Displayed at shop pages', 'Krypton'), 'before_widget' => '<div class="col-md-3 col-sm-6"><div class="widget %s %s">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>'));
    }
    add_action('wp_enqueue_scripts', 'dt_enqueue_color_scheme');
    add_action('wp_enqueue_scripts', 'dtheme_scripts', 999);
    add_action('wp_print_scripts', 'dtheme_register_var', 998);
    add_action('wp_print_scripts', 'detheme_print_inline_style');
    add_action('wp_footer', 'dtheme_register_mainmenu', 997);
    add_action('wp_enqueue_scripts', 'dtheme_css_style', 999);
    add_action('wp_footer', create_function('', 'global $krypton_Scripts;if(count($krypton_Scripts)) print "<script type=\\"text/javascript\\">\\n".@implode("\\n",$krypton_Scripts)."\\n</script>\\n";'), 99998);
}
	 * @since 1.0.0
	 *
	 * @link http://core.trac.wordpress.org/attachment/ticket/16149/query-standard-format-posts.php
	 * @link http://twitter.com/#!/markjaquith/status/66862769030438912
	 *
	 * @var Visual_Subtitle
	 */
    static $instance;
Example #15
0
/**
 * Load the textdomain / translations for the plugin.
 *
 * @since 0.1.4
 */
function bjgk_genesis_enews_load_translations()
{
    $domain = 'genesis-enews-extended';
    $locale = apply_filters('plugin_locale', get_locale(), $domain);
    load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
    load_plugin_textdomain($domain, false, basename(dirname(__FILE__)) . '/languages');
}
Example #16
0
 function __construct()
 {
     // helpers
     add_filter('acf/helpers/get_path', array($this, 'helpers_get_path'), 1, 1);
     add_filter('acf/helpers/get_dir', array($this, 'helpers_get_dir'), 1, 1);
     // vars
     $this->settings = array('path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'hook' => basename(dirname(__FILE__)) . '/' . basename(__FILE__), 'version' => '4.2.2', 'upgrade_version' => '3.4.1');
     // set text domain
     load_textdomain('acf', $this->settings['path'] . 'lang/acf-' . get_locale() . '.mo');
     // actions
     add_action('init', array($this, 'init'), 1);
     add_action('acf/save_post', array($this, 'save_post'), 10);
     add_action('acf/pre_save_post', array($this, 'save_post_lock'), 0);
     add_action('acf/pre_save_post', array($this, 'save_post_unlock'), 999);
     add_action('acf/save_post', array($this, 'save_post_lock'), 0);
     add_action('acf/save_post', array($this, 'save_post_unlock'), 999);
     // filters
     add_filter('acf/get_info', array($this, 'get_info'), 1, 1);
     add_filter('acf/parse_types', array($this, 'parse_types'), 1, 1);
     add_filter('acf/get_post_types', array($this, 'get_post_types'), 1, 3);
     add_filter('acf/get_taxonomies_for_select', array($this, 'get_taxonomies_for_select'), 1, 2);
     add_filter('acf/get_image_sizes', array($this, 'get_image_sizes'), 1, 1);
     add_action('acf/create_fields', array($this, 'create_fields'), 1, 2);
     add_action('acf/get_post_id', array($this, 'get_post_id'), 1, 1);
     // admin only
     if (is_admin() && !ACF_LITE) {
         add_action('admin_menu', array($this, 'admin_menu'));
         add_action('admin_head', array($this, 'admin_head'));
         add_filter('post_updated_messages', array($this, 'post_updated_messages'));
     }
     return true;
 }
Example #17
0
/**
 * Includes core files and adds the init action.
 * 
 * This function is executed on after_setup_theme, so you can add all the hooks you need
 * in functions.php, which is included before the after_setup_theme action is performed.
 */
function uf_load()
{
    global $ultimatefields;
    # Register plugin textdomain
    $mofile = UF_DIR . "/languages/uf-" . get_locale() . ".mo";
    if (file_exists($mofile)) {
        load_textdomain('uf', $mofile);
    }
    # Most classes will somehow be saved to $ultimatefields
    $ultimatefields = new stdClass();
    # Common functionality that's used accross the framework
    include_once 'common/common.php';
    # Include classes and functions
    include_once 'includes.php';
    # Register additional fields, templates, etc.
    do_action('uf_extend');
    # Buffer certain exceptions, which are not fatal.
    UF_Exceptions::buffer('non_existing_field');
    # Add UF options pages which provide admin interface for fields
    include_once 'settings/settings.php';
    # Indicate that the plugin is present so themes could check it.
    define('UF', true);
    # Fields are set up on init, but only in the admin, with priority 12
    add_action('init', 'uf_init', 12);
}
function load_sslp_textdomain()
{
    $domain = 'simple-staff-list';
    $locale = apply_filters('plugin_locale', get_locale(), $domain);
    load_textdomain($domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo');
    load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/_lang/');
}
 /**
  * Load the plugin text domain for translation.
  */
 public function load_plugin_textdomain()
 {
     $domain = $this->plugin_slug;
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
     load_plugin_textdomain($domain, FALSE, basename(plugin_dir_path(dirname(__FILE__))) . '/languages/');
 }
 function register_plugin($name, $base)
 {
     $this->plugin_name = $name;
     $this->plugin_base = rtrim(dirname($base), DS);
     $this->enqueue_scripts();
     $this->enqueue_styles();
     $this->initialize_classes();
     $this->initialize_options();
     if (function_exists('load_plugin_textdomain')) {
         $currentlocale = get_locale();
         if (!empty($currentlocale)) {
             $moFile = dirname(__FILE__) . DS . "languages" . DS . $this->plugin_name . "-" . $currentlocale . ".mo";
             if (@file_exists($moFile) && is_readable($moFile)) {
                 load_textdomain($this->plugin_name, $moFile);
             }
         }
     }
     if ($this->debugging == true) {
         global $wpdb;
         $wpdb->show_errors();
         error_reporting(E_ALL);
         @ini_set('display_errors', 1);
     }
     return true;
 }
 /**
  * Localisation
  */
 public function load_plugin_textdomain()
 {
     $locale = apply_filters('plugin_locale', get_locale(), PLUGINNAME_DOMAIN);
     $dir = trailingslashit(WP_LANG_DIR);
     load_textdomain(PLUGINNAME_DOMAIN, $dir . PLUGINNAME_DOMAIN . DIRECTORY_SEPARATOR . PLUGINNAME_DOMAIN . '-' . $locale . '.mo');
     load_plugin_textdomain(PLUGINNAME_DOMAIN, false, dirname(plugin_basename(__FILE__)) . DIRECTORY_SEPARATOR . 'languages');
 }
 function init_language()
 {
     $locale = apply_filters("plugin_locale", get_locale(), 'wplms-dashboard');
     if (file_exists(dirname(__FILE__) . '/languages/wplms-dashboard-' . $locale . '.mo')) {
         load_textdomain('wplms-dashboard', dirname(__FILE__) . '/languages/wplms-dashboard-' . $locale . '.mo');
     }
 }
 /**
  * Load Localisation files.
  *
  * Note: the first-loaded translation file overrides any following ones if the same translation is present
  */
 public function load_plugin_textdomain()
 {
     $locale = apply_filters('plugin_locale', get_locale(), 'sportspress-for-soccer');
     // Global + Frontend Locale
     load_textdomain('sportspress-for-soccer', WP_LANG_DIR . "/sportspress-for-soccer/sportspress-for-soccer-{$locale}.mo");
     load_plugin_textdomain('sportspress-for-soccer', false, plugin_basename(dirname(__FILE__) . "/languages"));
 }
function geodir_load_translation_geodirpayment()
{
    $locale = apply_filters('plugin_locale', get_locale(), GEODIRPAYMENT_TEXTDOMAIN);
    load_textdomain(GEODIRPAYMENT_TEXTDOMAIN, WP_LANG_DIR . '/' . GEODIRPAYMENT_TEXTDOMAIN . '/' . GEODIRPAYMENT_TEXTDOMAIN . '-' . $locale . '.mo');
    load_plugin_textdomain(GEODIRPAYMENT_TEXTDOMAIN, false, dirname(plugin_basename(__FILE__)) . '/geodir-payment-languages');
    include_once 'language.php';
}
 /**
  * load the plugin text domain for translation.
  *
  * @since 1.0.0
  * @return bool
  */
 public function load_plugin_textdomain()
 {
     $locale = apply_filters('wc_geolocation_based_products_plugin_locale', get_locale(), 'woocommerce-geolocation-based-products');
     load_textdomain('woocommerce-geolocation-based-products', trailingslashit(WP_LANG_DIR) . 'woocommerce-geolocation-based-products/woocommerce-geolocation-based-products' . '-' . $locale . '.mo');
     load_plugin_textdomain('woocommerce-geolocation-based-products', false, dirname(plugin_basename(__FILE__)) . '/languages');
     return true;
 }
Example #26
0
 /**
  * Initiate actions.
  *
  * @since  1.0.
  *
  * @return UnboxInit
  */
 public function __construct()
 {
     global $pagenow;
     // Create the key needed for checking the theme
     self::$key = 'unbox-' . md5(wp_get_theme()->template);
     // Determine the path of the Unbox directory relative to the theme directory
     self::$path = $this->get_relative_path();
     // Only load if on the right page
     if ('themes.php' === $pagenow && isset($_GET['activated']) && true === (bool) $_GET['activated'] && !$this->is_unboxed()) {
         /**
          * Load the .mo file. This is a reworking of "load_plugin_textdomain". Given that this is a plugin within
          * a theme, the file paths do not work correctly with "load_plugin_textdomain" or "load_theme_textdomain".
          * This functionality implements identical functionality with the correct paths.
          */
         $domain = 'unbox';
         $locale = apply_filters('plugin_locale', get_locale(), $domain);
         $path = WP_LANG_DIR . '/themes/';
         $mofile = $domain . '-' . $locale . '.mo';
         // Attempt to load from within the languages directory
         if (true !== load_textdomain($domain, $path . $mofile)) {
             // As a fallback, load from the plugin
             $path = trailingslashit(get_template_directory()) . self::$path . '/languages/';
             load_textdomain($domain, $path . $mofile);
         }
         // Add the CSS and JS to display the unboxing
         add_action('admin_enqueue_scripts', array($this, 'load_assets'), 20);
         // Add the HTML to display the unboxing
         add_action('admin_footer', array($this, 'load_template'), 20);
         // Because everything is unboxed, denote that the unboxing happened
         $this->denote_unboxed();
     }
 }
Example #27
0
 public function __construct()
 {
     $this->feather = \Slim\Slim::getInstance();
     $this->model = new \FeatherBB\Model\Userlist();
     load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'] . 'featherbb/lang/' . $this->feather->user->language . '/userlist.mo');
     load_textdomain('featherbb', $this->feather->forum_env['FEATHER_ROOT'] . 'featherbb/lang/' . $this->feather->user->language . '/search.mo');
 }
Example #28
0
 function __construct()
 {
     // helpers
     add_filter('acf/helpers/get_path', array($this, 'helpers_get_path'), 1, 1);
     add_filter('acf/helpers/get_dir', array($this, 'helpers_get_dir'), 1, 1);
     // vars
     $this->settings = array('path' => apply_filters('acf/helpers/get_path', __FILE__), 'dir' => apply_filters('acf/helpers/get_dir', __FILE__), 'hook' => basename(dirname(__FILE__)) . '/' . basename(__FILE__), 'version' => '4.4.5', 'upgrade_version' => '3.4.1', 'include_3rd_party' => false);
     // set text domain
     load_textdomain('acf', $this->settings['path'] . 'lang/acf-' . get_locale() . '.mo');
     // actions
     add_action('init', array($this, 'init'), 1);
     add_action('acf/pre_save_post', array($this, 'save_post_lock'), 0);
     add_action('acf/pre_save_post', array($this, 'save_post_unlock'), 999);
     add_action('acf/save_post', array($this, 'save_post_lock'), 0);
     add_action('acf/save_post', array($this, 'save_post'), 10);
     add_action('acf/save_post', array($this, 'save_post_unlock'), 999);
     add_action('acf/create_fields', array($this, 'create_fields'), 1, 2);
     // filters
     add_filter('acf/get_info', array($this, 'get_info'), 1, 1);
     add_filter('acf/parse_types', array($this, 'parse_types'), 1, 1);
     add_filter('acf/get_post_types', array($this, 'get_post_types'), 1, 3);
     add_filter('acf/get_taxonomies_for_select', array($this, 'get_taxonomies_for_select'), 1, 2);
     add_filter('acf/get_image_sizes', array($this, 'get_image_sizes'), 1, 1);
     add_filter('acf/get_post_id', array($this, 'get_post_id'), 1, 1);
     // includes
     $this->include_before_theme();
     add_action('after_setup_theme', array($this, 'include_after_theme'), 1);
     add_action('after_setup_theme', array($this, 'include_3rd_party'), 1);
 }
Example #29
0
function wpcf7_load_textdomain($locale = null)
{
    global $l10n;
    $domain = 'contact-form-7';
    if (get_locale() == $locale) {
        $locale = null;
    }
    if (empty($locale)) {
        if (is_textdomain_loaded($domain)) {
            return true;
        } else {
            return load_plugin_textdomain($domain, false, $domain . '/languages');
        }
    } else {
        $mo_orig = $l10n[$domain];
        unload_textdomain($domain);
        $mofile = $domain . '-' . $locale . '.mo';
        $path = WP_PLUGIN_DIR . '/' . $domain . '/languages';
        if ($loaded = load_textdomain($domain, $path . '/' . $mofile)) {
            return $loaded;
        } else {
            $mofile = WP_LANG_DIR . '/plugins/' . $mofile;
            return load_textdomain($domain, $mofile);
        }
        $l10n[$domain] = $mo_orig;
    }
    return false;
}
 /**
  * Load the plugin text domain for translation.
  *
  * @since 1.7.0
  */
 public function load_plugin_textdomain()
 {
     $domain = 'optionsframework';
     $locale = apply_filters('plugin_locale', get_locale(), $domain);
     load_textdomain($domain, trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
     load_plugin_textdomain($domain, FALSE, basename(dirname(__FILE__)) . '/languages');
 }