/** * @param wpdb $wpdb * @param SitePress $sitepress * @param WPML_Post_Translation $post_translation * @param WPML_Term_Translation $term_translation * @param string $page */ public function __construct(&$wpdb, &$sitepress, &$post_translation, &$term_translation, $page) { parent::__construct($sitepress, $wpdb, $post_translation, $term_translation); add_action('admin_print_scripts', array($this, 'wpml_js_scripts_setup')); add_action('admin_print_styles', array($this, 'wpml_css_setup')); $this->page = $page; }
/** * @param SitePress $sitepress * @param WPML_Query_Filter $query_filter */ public function __construct(&$sitepress, &$query_filter) { $wpdb = $sitepress->wpdb(); $post_translation = $sitepress->post_translations(); $term_translation = $sitepress->term_translations(); parent::__construct($sitepress, $wpdb, $post_translation, $term_translation); $this->query_filter =& $query_filter; }
/** * @param SitePress $sitepress * @param wpdb $wpdb * @param WPML_Post_Translation $post_translations * @param WPML_Term_Translation $term_translations */ public function __construct(&$sitepress, &$wpdb, &$post_translations, &$term_translations) { parent::__construct($sitepress, $wpdb, $post_translations, $term_translations); add_action('wp_delete_nav_menu', array($this, 'wp_delete_nav_menu')); add_action('wp_create_nav_menu', array($this, 'wp_update_nav_menu'), 10, 2); add_action('wp_update_nav_menu', array($this, 'wp_update_nav_menu'), 10, 2); add_action('wp_update_nav_menu_item', array($this, 'wp_update_nav_menu_item'), 10, 3); add_action('delete_post', array($this, 'wp_delete_nav_menu_item')); add_filter('pre_update_option_theme_mods_' . get_option('stylesheet'), array($this, 'pre_update_theme_mods_theme')); if (is_admin()) { add_filter('theme_mod_nav_menu_locations', array($this, 'theme_mod_nav_menu_locations')); } }
function __construct(&$sitepress, &$wpdb, &$post_translations, &$term_translation) { global $pagenow; parent::__construct($sitepress, $wpdb, $post_translations, $term_translation); add_action('init', array($this, 'init')); $this->nav_menu_actions = new WPML_Nav_Menu_Actions($sitepress, $wpdb, $post_translations, $term_translation); if (is_admin()) { // filter for nav_menu_options add_filter('option_nav_menu_options', array($this, 'option_nav_menu_options')); add_filter('wp_get_nav_menus', array($this, 'wp_get_nav_menus_filter'), 10, 1); } // filter menus by language - also on the widgets page if ($pagenow === 'nav-menus.php' || $pagenow === 'widgets.php' || isset($_GET['page']) && $_GET['page'] == ICL_PLUGIN_FOLDER . '/menu/languages.php' || isset($_POST['action']) && $_POST['action'] == 'save-widget') { add_filter('get_terms', array($this, 'get_terms_filter'), 1, 3); } add_filter('wp_nav_menu_args', array($this, 'wp_nav_menu_args_filter')); add_filter('wp_nav_menu_items', array($this, 'wp_nav_menu_items_filter')); add_filter('nav_menu_meta_box_object', array($this, '_enable_sitepress_query_filters')); }
/** * @param SitePress $sitepress * @param wpdb $wpdb * @param WPML_Post_Translation $post_translations * @param WPML_Term_Translation $term_translation */ function __construct($sitepress, $wpdb, $post_translations, $term_translation) { parent::__construct($sitepress, $wpdb, $post_translations, $term_translation); $this->menu_items_cache = array(); }
/** * @param SitePress $sitepress * @param wpdb $wpdb * @param WPML_Post_Translation $post_translation * @param WPML_Term_Translation $term_translation * @param WPML_Query_Filter $query_filter */ public function __construct(&$sitepress, &$wpdb, &$post_translation, &$term_translation, &$query_filter) { parent::__construct($sitepress, $wpdb, $post_translation, $term_translation); $this->query_filter =& $query_filter; }