$locale = apply_filters('plugin_locale', get_locale(), 'plugin-name'); $mofile = sprintf('%1$s-%2$s.mo', 'plugin-name', $locale); // Setup paths to current locale file $mofile_local = $plugin_name_lang_dir . $mofile; if (file_exists($mofile_local)) { // Look in local /wp-content/plugins/plugin-name/languages/ folder load_textdomain('plugin-name', $mofile_local); } else { // Load the default language files load_plugin_textdomain('plugin-name', false, $plugin_name_lang_dir); } } } /** * The main function responsible for returning the one true Plugin_Name * Instance to functions everywhere. * * Use this function like you would a global variable, except without needing * to declare the global. * * * @since 1.0.0 * @return object The one true Plugin_Name Instance */ function Plugin_Name() { return Plugin_Name::instance(); } // Get Plugin_Name Running Plugin_Name();
/** * If we have just installed the plugin, show a message. * * return string * @access public * @since 1.0.0 */ public function update_notice() { echo self::the_notice('updated', sprintf(__('<strong>%s Data Update Required</strong> – We just need to update your install to the latest version. <a href="' . esc_url(add_query_arg('do_update_plugin_name', 'true', admin_url())) . '" class="plugin-name-update-now button-primary">' . __('Run the updater', 'plugin-name') . '</a>', 'plugin-name'), Plugin_Name()->name)); }