PluginProbe
Polylang / 2.8
Polylang v2.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | admin/admin-nav-menu.php +5 -13 3.02.8 View file →
@@ -32,10 +32,8 @@
32 32 * Setups filters and terms
33 33 * adds the language switcher metabox and create new nav menu locations
34 34 *
35 35 * @since 1.1
36 - *
37 - * @return void
38 36 */
39 37 public function admin_init() {
40 38 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
41 39 add_action( 'wp_update_nav_menu_item', array( $this, 'wp_update_nav_menu_item' ), 10, 2 );
@@ -56,10 +54,8 @@
56 54 * The checkbox and all hidden fields are important
57 55 * Thanks to John Morris for his very interesting post http://www.johnmorrisonline.com/how-to-add-a-fully-functional-custom-meta-box-to-wordpress-navigation-menus/
58 56 *
59 57 * @since 1.1
60 - *
61 - * @return void
62 58 */
63 59 public function lang_switch() {
64 60 global $_nav_menu_placeholder, $nav_menu_selected_id;
65 61 $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
@@ -90,19 +86,17 @@
90 86 /**
91 87 * Prepares javascript to modify the language switcher menu item
92 88 *
93 89 * @since 1.1
94 - *
95 - * @return void
96 90 */
97 91 public function admin_enqueue_scripts() {
98 92 $screen = get_current_screen();
99 - if ( empty( $screen ) || 'nav-menus' !== $screen->base ) {
93 + if ( 'nav-menus' != $screen->base ) {
100 94 return;
101 95 }
102 96
103 97 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
104 - wp_enqueue_script( 'pll_nav_menu', plugins_url( '/js/build/nav-menu' . $suffix . '.js', POLYLANG_BASENAME ), array( 'jquery' ), POLYLANG_VERSION );
98 + wp_enqueue_script( 'pll_nav_menu', plugins_url( '/js/nav-menu' . $suffix . '.js', POLYLANG_FILE ), array( 'jquery' ), POLYLANG_VERSION );
105 99
106 100 $data = array(
107 101 'strings' => PLL_Switcher::get_switcher_options( 'menu', 'string' ), // The strings for the options
108 102 'title' => __( 'Languages', 'polylang' ), // The title
@@ -135,9 +129,8 @@
135 129 * @since 1.1
136 130 *
137 131 * @param int $menu_id not used
138 132 * @param int $menu_item_db_id
139 - * @return void
140 133 */
141 134 public function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0 ) {
142 135 if ( empty( $_POST['menu-item-url'][ $menu_item_db_id ] ) || '#pll_switcher' !== $_POST['menu-item-url'][ $menu_item_db_id ] ) { // phpcs:ignore WordPress.Security.NonceVerification
143 136 return;
@@ -185,14 +178,14 @@
185 178 return $locations;
186 179 }
187 180
188 181 /**
189 - * Assign menu languages and translations based on ( temporary ) locations.
182 + * Assign menu languages and translations based on ( temporary ) locations
190 183 *
191 184 * @since 1.1
192 185 *
193 - * @param mixed $mods Theme mods.
194 - * @return mixed
186 + * @param array $mods theme mods
187 + * @return unmodified $mods
195 188 */
196 189 public function pre_update_option_theme_mods( $mods ) {
197 190 if ( current_user_can( 'edit_theme_options' ) && isset( $mods['nav_menu_locations'] ) ) {
198 191
@@ -259,9 +252,8 @@
259 252 *
260 253 * @since 1.7.3
261 254 *
262 255 * @param int $term_id nav menu id
263 - * @return void
264 256 */
265 257 public function delete_nav_menu( $term_id ) {
266 258 if ( isset( $this->options['nav_menus'] ) ) {
267 259 foreach ( $this->options['nav_menus'] as $theme => $locations ) {