Changeset 3296646
- Timestamp:
- 05/19/2025 04:18:30 PM (9 months ago)
- Location:
- bellows-accordion-menu/trunk
- Files:
-
- 4 edited
-
bellows-accordion-menu.php (modified) (2 diffs)
-
includes/bellows.api.php (modified) (17 diffs)
-
languages/bellows.pot (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bellows-accordion-menu/trunk/bellows-accordion-menu.php
r2986331 r3296646 5 5 * Plugin URI: http://getbellows.com 6 6 * Description: A flexible and robust WordPress accordion menu plugin 7 * Version: 1.4. 37 * Version: 1.4.4 8 8 * Requires at least: 5.0 9 9 * Requires PHP: 7.4 … … 14 14 */ 15 15 16 if( ! defined( 'WPINC' ) ) die; // If this file is called directly, abort. 16 if (!defined('WPINC')) 17 die; // If this file is called directly, abort. 17 18 18 if( ! defined( 'BELLOWS_VERSION' ) ) define( 'BELLOWS_VERSION', '1.4.3' ); 19 if( ! defined( 'BELLOWS_PRO' ) ) define( 'BELLOWS_PRO' , false ); 19 if (!defined('BELLOWS_VERSION')) 20 define('BELLOWS_VERSION', '1.4.4'); 21 if (!defined('BELLOWS_PRO')) 22 define('BELLOWS_PRO', false); 20 23 21 if( ! defined( 'BELLOWS_BASENAME' ) ) define( 'BELLOWS_BASENAME', plugin_basename( __FILE__ ) ); 22 if( ! defined( 'BELLOWS_BASEDIR' ) ) define( 'BELLOWS_BASEDIR', dirname( plugin_basename(__FILE__) ) ); 23 if( ! defined( 'BELLOWS_FILE' ) ) define( 'BELLOWS_FILE', __FILE__ ); 24 if( ! defined( 'BELLOWS_URL' ) ) define( 'BELLOWS_URL', plugin_dir_url( __FILE__ ) ); 25 if( ! defined( 'BELLOWS_DIR' ) ) define( 'BELLOWS_DIR', plugin_dir_path( __FILE__ ) ); 26 if( ! defined( 'BELLOWS_ADMIN_CAP' ) ) define( 'BELLOWS_ADMIN_CAP', 'manage_options' ); 24 if (!defined('BELLOWS_BASENAME')) 25 define('BELLOWS_BASENAME', plugin_basename(__FILE__)); 26 if (!defined('BELLOWS_BASEDIR')) 27 define('BELLOWS_BASEDIR', dirname(plugin_basename(__FILE__))); 28 if (!defined('BELLOWS_FILE')) 29 define('BELLOWS_FILE', __FILE__); 30 if (!defined('BELLOWS_URL')) 31 define('BELLOWS_URL', plugin_dir_url(__FILE__)); 32 if (!defined('BELLOWS_DIR')) 33 define('BELLOWS_DIR', plugin_dir_path(__FILE__)); 34 if (!defined('BELLOWS_ADMIN_CAP')) 35 define('BELLOWS_ADMIN_CAP', 'manage_options'); 27 36 28 include( 'Bellows.class.php'); //Let's get the party started37 include('Bellows.class.php'); //Let's get the party started -
bellows-accordion-menu/trunk/includes/bellows.api.php
r2986331 r3296646 1 1 <?php 2 2 3 function bellows_menu_toggle( $menu_id, $content, $btn_class, $args ){ 4 $content = apply_filters( 'bellows_menu_toggle_content', $content, $menu_id, $args ); 5 $btn = '<button class="bellows-menu-toggle '.esc_attr($btn_class).'" aria-controls="'.esc_attr($menu_id).'">'.$content.'</button>'; 6 return apply_filters( 'bellows_menu_toggle', $btn, $menu_id, $args ); 3 function bellows_menu_toggle($menu_id, $content, $btn_class, $args) 4 { 5 $content = apply_filters('bellows_menu_toggle_content', $content, $menu_id, $args); 6 $btn = '<button class="bellows-menu-toggle ' . esc_attr($btn_class) . '" aria-controls="' . esc_attr($menu_id) . '">' . $content . '</button>'; 7 return apply_filters('bellows_menu_toggle', $btn, $menu_id, $args); 7 8 } 8 9 … … 14 15 * 15 16 */ 16 function bellows( $config_id = 'main' , $menu_args = [] ){ 17 18 $config_id = bellows_validate_config_id( $config_id ); 19 20 _BELLOWS()->set_current_config_id( $config_id ); 17 function bellows($config_id = 'main', $menu_args = []) 18 { 19 20 $config_id = bellows_validate_config_id($config_id); 21 22 _BELLOWS()->set_current_config_id($config_id); 21 23 22 24 $menu_args['bellows_source'] = 'menu'; // Default source 23 $args = bellows_get_nav_menu_args( $config_id , $menu_args);25 $args = bellows_get_nav_menu_args($config_id, $menu_args); 24 26 $toggle = bellows_output_responsive_toggle($config_id, $args); 25 27 26 28 // Generate the menu (wp_nav_menu will print if we're printing) 27 $menu = wp_nav_menu( $args);29 $menu = wp_nav_menu($args); 28 30 29 31 // $menu will be empty if we're printing, but $toggle will not … … 32 34 33 35 34 add_shortcode( 'bellows' , 'bellows_shortcode' ); 35 function bellows_shortcode( $atts, $content = null ){ 36 37 extract( shortcode_atts( array( 38 'config_id' => 'main', 39 'theme_location' => '', 40 'menu' => '', 36 add_shortcode('bellows', 'bellows_shortcode'); 37 function bellows_shortcode($atts, $content = null) 38 { 39 40 extract(shortcode_atts(array( 41 'config_id' => 'main', 42 'theme_location' => '', 43 'menu' => '', 41 44 ), $atts)); 42 45 43 46 44 47 $args = array(); 45 48 $args['echo'] = false; 46 49 47 50 48 if ( $theme_location ){51 if ($theme_location) { 49 52 $args['theme_location'] = $theme_location; 50 53 } 51 if ( $menu ){54 if ($menu) { 52 55 $args['menu'] = $menu; 53 56 } 54 57 55 return bellows( $config_id , $args);58 return bellows($config_id, $args); 56 59 57 60 … … 61 64 * Numeric menu ID is required 62 65 */ 63 function bellows_section( string $config_id, array $menu_args, array $section_args ){ 64 65 $config_id = bellows_validate_config_id( $config_id ); 66 67 if( !BELLOWS_PRO ){ 66 function bellows_section(string $config_id, array $menu_args, array $section_args) 67 { 68 69 $config_id = bellows_validate_config_id($config_id); 70 71 if (!BELLOWS_PRO) { 68 72 return bellows_admin_notice( 69 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Bellows Menu Section feature.' ,73 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Bellows Menu Section feature.', 70 74 false 71 75 ); 72 76 } 73 77 74 if ( !isset( $menu_args['menu'] ) ){78 if (!isset($menu_args['menu'])) { 75 79 return '<!-- No menu ID passed, cannot generate Bellows Section -->'; 76 80 } 77 if ( !isset( $section_args['root']) ){81 if (!isset($section_args['root'])) { 78 82 return '<!-- No section root passed, cannot generate Bellows Section -->'; 79 83 } 80 84 81 _BELLOWS()->set_current_config_id( $config_id);85 _BELLOWS()->set_current_config_id($config_id); 82 86 83 87 $menu_args['bellows_source'] = 'section'; // Default source 84 88 $menu_args['bellows_section'] = $section_args; 85 $args = bellows_get_nav_menu_args( $config_id , $menu_args);86 $args['container_id'] = 'bellows-' .$config_id.'-'.sanitize_key( $menu_args['menu'] ).'-section-'.$section_args['root'];89 $args = bellows_get_nav_menu_args($config_id, $menu_args); 90 $args['container_id'] = 'bellows-' . $config_id . '-' . sanitize_key($menu_args['menu']) . '-section-' . $section_args['root']; 87 91 88 92 // // Should the toggle and menu be printed … … 100 104 101 105 // Generate the menu (wp_nav_menu will print if we're printing) 102 add_filter( 'wp_nav_menu_objects' , 'bellows_filter_section' , 10, 2);103 $menu = wp_nav_menu( $args);104 remove_filter( 'wp_nav_menu_objects' , 'bellows_filter_section' , 10, 2);106 add_filter('wp_nav_menu_objects', 'bellows_filter_section', 10, 2); 107 $menu = wp_nav_menu($args); 108 remove_filter('wp_nav_menu_objects', 'bellows_filter_section', 10, 2); 105 109 106 110 // $menu will be empty if we're printing, but $toggle will not … … 108 112 } 109 113 110 add_shortcode( 'bellows_section' , 'bellows_section_shortcode' ); 111 function bellows_section_shortcode( $atts, $content = null ){ 112 113 extract( shortcode_atts( [ 114 'config_id' => 'main', 115 'menu' => '', 116 'root' => '', 117 'include_root' => 'false', 114 add_shortcode('bellows_section', 'bellows_section_shortcode'); 115 function bellows_section_shortcode($atts, $content = null) 116 { 117 118 extract(shortcode_atts([ 119 'config_id' => 'main', 120 'menu' => '', 121 'root' => '', 122 'include_root' => 'false', 118 123 ], $atts)); 119 124 … … 122 127 123 128 124 if ( $menu ){129 if ($menu) { 125 130 $args['menu'] = $menu; 126 131 } 127 132 128 $include_root = strtolower( $include_root) === 'true' ? true : false;133 $include_root = strtolower($include_root) === 'true' ? true : false; 129 134 130 135 $section_args = [ 131 'root' => $root,136 'root' => $root, 132 137 'include_root' => $include_root, 133 138 ]; 134 139 135 return bellows_section( $config_id , $args, $section_args ); 136 137 } 138 139 140 141 function bellows_terms( $config_id = 'main' , $term_args = array() , $menu_args = array() ){ 142 143 if( !BELLOWS_PRO ){ 140 return bellows_section($config_id, $args, $section_args); 141 142 } 143 144 145 146 function bellows_terms($config_id = 'main', $term_args = array(), $menu_args = array()) 147 { 148 149 if (!BELLOWS_PRO) { 144 150 return bellows_admin_notice( 145 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Terms Autopopulation feature.' ,151 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Terms Autopopulation feature.', 146 152 false 147 153 ); 148 154 } 149 155 150 $config_id = bellows_validate_config_id( $config_id);156 $config_id = bellows_validate_config_id($config_id); 151 157 152 158 // If 'taxonomies' is passed, convert to 'taxonomy' 153 if ( isset( $term_args['taxonomies'] ) && !isset( $term_args['taxonomy'] ) ){159 if (isset($term_args['taxonomies']) && !isset($term_args['taxonomy'])) { 154 160 $term_args['taxonomy'] = $term_args['taxonomies']; 155 161 } 156 162 157 163 $term_args_defaults = array( 158 'taxonomy' => 'category',159 'number' => 0,160 'offset' => '',161 'child_of' => 0,162 'order' => 'ASC',163 'orderby' => 'name',164 'hide_empty' => true,165 'hierarchical' => true,166 'exclude' => '',167 'counts' => false,164 'taxonomy' => 'category', 165 'number' => 0, 166 'offset' => '', 167 'child_of' => 0, 168 'order' => 'ASC', 169 'orderby' => 'name', 170 'hide_empty' => true, 171 'hierarchical' => true, 172 'exclude' => '', 173 'counts' => false, 168 174 ); 169 $term_args = wp_parse_args( $term_args, $term_args_defaults);175 $term_args = wp_parse_args($term_args, $term_args_defaults); 170 176 171 177 // Set up meta_term_order custom meta query if that's the selected orderby field 172 if ( $term_args['orderby'] === 'meta_term_order' ){178 if ($term_args['orderby'] === 'meta_term_order') { 173 179 // Set up custom meta query 174 180 $term_args['meta_query'] = [ … … 179 185 ]; 180 186 } 181 182 183 _BELLOWS()->set_current_config_id( $config_id);187 188 189 _BELLOWS()->set_current_config_id($config_id); 184 190 185 191 … … 190 196 // Assign the depth, but only if it's actually set - if we set it to '', which is the default coming from 191 197 // the generator due to the empty string text field, that blows everything up 192 if ( isset( $term_args['depth'] ) && $term_args['depth'] !== '' ){198 if (isset($term_args['depth']) && $term_args['depth'] !== '') { 193 199 $menu_args['depth'] = $term_args['depth']; 194 200 } 195 201 196 202 197 $menu_args = bellows_get_nav_menu_args( $config_id , $menu_args);203 $menu_args = bellows_get_nav_menu_args($config_id, $menu_args); 198 204 // bellp( $menu_args ); 199 205 … … 201 207 202 208 //add_filter( 'wp_get_nav_menu_items' , 'bellows_populate_terms' , 10, 3 ); 203 add_filter( 'wp_nav_menu_objects' , 'bellows_populate_terms' , 10, 2);204 $menu = wp_nav_menu( $menu_args);205 remove_filter( 'wp_nav_menu_objects' , 'bellows_populate_terms' , 10, 2);209 add_filter('wp_nav_menu_objects', 'bellows_populate_terms', 10, 2); 210 $menu = wp_nav_menu($menu_args); 211 remove_filter('wp_nav_menu_objects', 'bellows_populate_terms', 10, 2); 206 212 //remove_filter( 'wp_get_nav_menu_items' , 'bellows_populate_terms' , 10, 3 ); 207 213 … … 212 218 213 219 214 add_shortcode( 'bellows_terms' , 'bellows_terms_shortcode' ); 215 function bellows_terms_shortcode( $atts, $content = null ){ 216 217 $term_args = shortcode_atts( array( 218 'config_id' => 'main', 219 220 'taxonomy' => 'category', 221 'number' => '', 222 'offset' => '', 223 'orderby' => 'name', 224 'order' => 'ASC', 225 'hide_empty' => 'true', 226 'hierarchical' => 'true', 227 'child_of' => 0, 228 'depth' => 0, 229 'exclude' => '', 230 'counts' => false, 220 add_shortcode('bellows_terms', 'bellows_terms_shortcode'); 221 function bellows_terms_shortcode($atts, $content = null) 222 { 223 224 $term_args = shortcode_atts(array( 225 'config_id' => 'main', 226 227 'taxonomy' => 'category', 228 'number' => '', 229 'offset' => '', 230 'orderby' => 'name', 231 'order' => 'ASC', 232 'hide_empty' => 'true', 233 'hierarchical' => 'true', 234 'child_of' => 0, 235 'depth' => 0, 236 'exclude' => '', 237 'counts' => false, 231 238 232 239 ), $atts); 233 240 234 extract( $term_args);241 extract($term_args); 235 242 236 243 $menu_args = array(); 237 244 $menu_args['echo'] = false; 238 245 239 $taxonomies = isset( $atts['taxonomies']) ? $atts['taxonomies'] : $taxonomy;240 241 if ( $taxonomies ){242 243 unset( $term_args['config_id']);246 $taxonomies = isset($atts['taxonomies']) ? $atts['taxonomies'] : $taxonomy; 247 248 if ($taxonomies) { 249 250 unset($term_args['config_id']); 244 251 245 252 //Taxonomies 246 $taxonomies = explode( ',' , $taxonomies);247 foreach ( $taxonomies as $key => $tax ){248 $taxonomies[$key] = trim( $tax);253 $taxonomies = explode(',', $taxonomies); 254 foreach ($taxonomies as $key => $tax) { 255 $taxonomies[$key] = trim($tax); 249 256 } 250 257 $term_args['taxonomy'] = $taxonomies; 251 258 252 259 //TODO: Handle booleans that are strings 253 if( $term_args['hide_empty'] == 'false' ) $term_args['hide_empty'] = false; 254 else if( $term_args['hide_empty'] == 'true' ) $term_args['hide_empty'] = true; 255 if( $term_args['hierarchical'] == 'false' ) $term_args['hierarchical'] = false; 256 else if( $term_args['hierarchical'] == 'true' ) $term_args['hierarchical'] = true; 260 if ($term_args['hide_empty'] == 'false') 261 $term_args['hide_empty'] = false; 262 else if ($term_args['hide_empty'] == 'true') 263 $term_args['hide_empty'] = true; 264 if ($term_args['hierarchical'] == 'false') 265 $term_args['hierarchical'] = false; 266 else if ($term_args['hierarchical'] == 'true') 267 $term_args['hierarchical'] = true; 257 268 258 269 //if( $child_of ) $term_args['child_of'] = $child_of; 259 270 260 271 //bellp( $term_args ); 261 return bellows_terms( $config_id , $term_args , $menu_args);272 return bellows_terms($config_id, $term_args, $menu_args); 262 273 } 263 274 … … 269 280 270 281 271 function bellows_posts( $config_id = 'main' , $post_args = array() , $menu_args = array( 'echo' => true ) ){ 272 273 if( !BELLOWS_PRO ){ 282 function bellows_posts($config_id = 'main', $post_args = array(), $menu_args = array('echo' => true)) 283 { 284 285 if (!BELLOWS_PRO) { 274 286 return bellows_admin_notice( 275 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Posts Autopopulation feature.' ,287 'Upgrade to <a href="' . BELLOWS_PRO_URL . '">Bellows Pro</a> to use the Posts Autopopulation feature.', 276 288 false 277 289 ); 278 290 } 279 291 280 $config_id = bellows_validate_config_id( $config_id);292 $config_id = bellows_validate_config_id($config_id); 281 293 282 294 $post_arg_defaults = array( 283 'post_type' => 'page',284 'post_parent' => '', //0,295 'post_type' => 'page', 296 'post_parent' => '', //0, 285 297 'include_parent' => false, 286 'numberposts' => -1,287 'offset' => 0,288 'orderby' => 'title',289 'order' => 'ASC',290 'author' => '',291 'cat' => '', //ID292 'category__and' => '',293 'category__in' => '',294 'tag_id' => '', //ID295 'tag__and' => '',296 'tag__in' => '',297 'depth' => 2,298 'exclude' => '',298 'numberposts' => -1, 299 'offset' => 0, 300 'orderby' => 'title', 301 'order' => 'ASC', 302 'author' => '', 303 'cat' => '', //ID 304 'category__and' => '', 305 'category__in' => '', 306 'tag_id' => '', //ID 307 'tag__and' => '', 308 'tag__in' => '', 309 'depth' => 2, 310 'exclude' => '', 299 311 300 312 ); 301 313 302 $taxonomies = get_taxonomies( array(303 'public'=> true,304 //'_builtin' => true,305 ));306 foreach ( $taxonomies as $tax_name ){307 $post_arg_defaults['tax_' .$tax_name] = '';308 } 309 310 $post_args = wp_parse_args( $post_args, $post_arg_defaults);311 //bellp( $post_args );314 $taxonomies = get_taxonomies(array( 315 'public' => true, 316 //'_builtin' => true, 317 )); 318 foreach ($taxonomies as $tax_name) { 319 $post_arg_defaults['tax_' . $tax_name] = ''; 320 } 321 322 $post_args = wp_parse_args($post_args, $post_arg_defaults); 323 //bellp( $post_args ); 312 324 313 325 //Inherit current page as parent 314 if ( $post_args['post_parent'] < 0 ){315 $post_args['post_parent'] = bellows_get_dynamic_post_parent( $post_args['post_parent']);316 } 317 //bellp( $post_args );318 319 foreach ( $post_args as $arg_name => $val ){326 if ($post_args['post_parent'] < 0) { 327 $post_args['post_parent'] = bellows_get_dynamic_post_parent($post_args['post_parent']); 328 } 329 //bellp( $post_args ); 330 331 foreach ($post_args as $arg_name => $val) { 320 332 321 333 //Expand taxonomy queries 322 if ( $val && strpos( $arg_name , 'tax_' ) === 0 ){323 $tax_id = substr( $arg_name , 4);324 unset( $post_args[$arg_name]);325 326 if ( !isset( $post_args['tax_query'] ) ){334 if ($val && strpos($arg_name, 'tax_') === 0) { 335 $tax_id = substr($arg_name, 4); 336 unset($post_args[$arg_name]); 337 338 if (!isset($post_args['tax_query'])) { 327 339 $post_args['tax_query'] = array(); 328 340 } 329 341 $post_args['tax_query'][] = array( 330 'taxonomy' => $tax_id,331 'field' => 'term_id',332 'terms' => $val,342 'taxonomy' => $tax_id, 343 'field' => 'term_id', 344 'terms' => $val, 333 345 ); 334 346 } … … 336 348 //bellp( $post_args ); 337 349 338 _BELLOWS()->set_current_config_id( $config_id);350 _BELLOWS()->set_current_config_id($config_id); 339 351 340 352 … … 343 355 $menu_args['bellows_populate_posts'] = true; 344 356 345 $menu_args = bellows_get_nav_menu_args( $config_id , $menu_args);357 $menu_args = bellows_get_nav_menu_args($config_id, $menu_args); 346 358 347 359 $toggle = bellows_output_responsive_toggle($config_id, $menu_args); … … 354 366 //add_filter( 'wp_get_nav_menu_items' , 'bellows_populate_terms' , 10, 3 ); 355 367 //add_filter( 'wp_get_nav_menu_object' , 'bellows_dummy_menu_object' , 10 ); 356 add_filter( 'wp_nav_menu_objects' , 'bellows_populate_posts' , 10, 2);357 $menu = wp_nav_menu( $menu_args);358 remove_filter( 'wp_nav_menu_objects' , 'bellows_populate_posts' , 10, 2);368 add_filter('wp_nav_menu_objects', 'bellows_populate_posts', 10, 2); 369 $menu = wp_nav_menu($menu_args); 370 remove_filter('wp_nav_menu_objects', 'bellows_populate_posts', 10, 2); 359 371 //remove_filter( 'wp_get_nav_menu_items' , 'bellows_populate_terms' , 10, 3 ); 360 372 361 373 //TODO: ECHO OR RETURN CHECK 362 return $toggle.$menu; 363 364 } 365 366 function bellows_posts_shortcode( $atts, $content = null ){ 374 return $toggle . $menu; 375 376 } 377 378 function bellows_posts_shortcode($atts, $content = null) 379 { 367 380 368 381 $post_arg_defaults = array( 369 'config_id' => 'main',370 'post_type' => 'page',371 'post_parent' => '',372 'include_parent' => false,373 'numberposts' => -1,374 'orderby' => 'title',375 'order' => 'ASC',376 'depth' => 2,377 'exclude' => '',382 'config_id' => 'main', 383 'post_type' => 'page', 384 'post_parent' => '', 385 'include_parent' => false, 386 'numberposts' => -1, 387 'orderby' => 'title', 388 'order' => 'ASC', 389 'depth' => 2, 390 'exclude' => '', 378 391 ); 379 $taxonomies = get_taxonomies( array(380 'public'=> true,381 //'_builtin' => true,382 ));383 foreach ( $taxonomies as $tax_name ){384 $post_arg_defaults['tax_' .$tax_name] = '';385 } 386 387 $post_args = shortcode_atts( $post_arg_defaults, $atts);388 389 extract( $post_args);392 $taxonomies = get_taxonomies(array( 393 'public' => true, 394 //'_builtin' => true, 395 )); 396 foreach ($taxonomies as $tax_name) { 397 $post_arg_defaults['tax_' . $tax_name] = ''; 398 } 399 400 $post_args = shortcode_atts($post_arg_defaults, $atts); 401 402 extract($post_args); 390 403 391 404 //Menu Arguments … … 395 408 396 409 //Post Query Arguments 397 unset( $post_args['config_id']);410 unset($post_args['config_id']); 398 411 399 412 400 413 // Handle booleans that are strings 401 if( $post_args['include_parent'] === 'false' ) $post_args['include_parent'] = false; 402 else if( $post_args['include_parent'] === 'true' ) $post_args['include_parent'] = true; 403 404 405 return bellows_posts( $config_id , $post_args , $menu_args ); 406 407 } 408 add_shortcode( 'bellows_posts' , 'bellows_posts_shortcode' ); 409 410 411 412 413 414 function bellows_menu( $query_id , $menu_args = array() ){ 415 416 if( !$query_id ){ 417 bellows_admin_notice( 'No Saved Query ID provided, cannot display menu' ); 414 if ($post_args['include_parent'] === 'false') 415 $post_args['include_parent'] = false; 416 else if ($post_args['include_parent'] === 'true') 417 $post_args['include_parent'] = true; 418 419 420 return bellows_posts($config_id, $post_args, $menu_args); 421 422 } 423 add_shortcode('bellows_posts', 'bellows_posts_shortcode'); 424 425 426 427 428 429 function bellows_menu($query_id, $menu_args = array()) 430 { 431 432 if (!$query_id) { 433 bellows_admin_notice('No Saved Query ID provided, cannot display menu'); 418 434 return; 419 435 } 420 436 421 $query = get_post( $query_id);422 if ( $query->post_type != 'bellows_query' ){423 bellows_admin_notice( 'Post is not a Bellow Query ' . '['.$query_id.'].');437 $query = get_post($query_id); 438 if (!$query || $query->post_type != 'bellows_query') { 439 bellows_admin_notice('Post is not a Bellows Query ' . '[' . esc_html($query_id) . '].'); 424 440 return; 425 441 } 426 442 427 443 428 $query_type = get_post_meta( $query_id , 'query_type' , true);429 $query_args = get_post_meta( $query_id , 'query_args' , true);430 //bellp( $query_args );444 $query_type = get_post_meta($query_id, 'query_type', true); 445 $query_args = get_post_meta($query_id, 'query_args', true); 446 //bellp( $query_args ); 431 447 $config_id = $query_args['config_id']; 432 unset( $query_args['config_id']);433 434 switch ( $query_type ){448 unset($query_args['config_id']); 449 450 switch ($query_type) { 435 451 case 'post': 436 return bellows_posts( $config_id , $query_args , $menu_args);452 return bellows_posts($config_id, $query_args, $menu_args); 437 453 break; 438 454 case 'term': 439 455 //Convert saved string to array if necessary 440 $taxonomies = explode( ',' , $query_args['taxonomies']);441 foreach ( $taxonomies as $key => $tax ){442 $taxonomies[$key] = trim( $tax);456 $taxonomies = explode(',', $query_args['taxonomies']); 457 foreach ($taxonomies as $key => $tax) { 458 $taxonomies[$key] = trim($tax); 443 459 } 444 460 $query_args['taxonomies'] = $taxonomies; 445 461 446 return bellows_terms( $config_id , $query_args , $menu_args);462 return bellows_terms($config_id, $query_args, $menu_args); 447 463 break; 448 464 … … 453 469 454 470 } 455 function bellows_menu_shortcode( $atts , $content = null ){ 471 function bellows_menu_shortcode($atts, $content = null) 472 { 456 473 $defaults = array( 457 'qid' => 0,474 'qid' => 0, 458 475 ); 459 extract( shortcode_atts( $defaults , $atts ));460 461 return bellows_menu( $qid , array( 'echo' => false));462 } 463 add_shortcode( 'bellows_menu' , 'bellows_menu_shortcode');476 extract(shortcode_atts($defaults, $atts)); 477 478 return bellows_menu($qid, array('echo' => false)); 479 } 480 add_shortcode('bellows_menu', 'bellows_menu_shortcode'); -
bellows-accordion-menu/trunk/languages/bellows.pot
r2986331 r3296646 1 # Copyright (C) 202 3SevenSpark1 # Copyright (C) 2025 SevenSpark 2 2 # This file is distributed under the same license as the Bellows Pro - Accordion Menu package. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Bellows Pro - Accordion Menu 1.4. 3\n"5 "Project-Id-Version: Bellows Pro - Accordion Menu 1.4.4\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bellows-pro\n" 7 "POT-Creation-Date: 202 3-10-30 17:08:51+00:00\n"7 "POT-Creation-Date: 2025-05-19 16:16:56+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 202 3-MO-DA HO:MI+ZONE\n"11 "PO-Revision-Date: 2025-MO-DA HO:MI+ZONE\n" 12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 13 "Language-Team: LANGUAGE <[email protected]>\n" -
bellows-accordion-menu/trunk/readme.txt
r2986331 r3296646 4 4 Tags: menu, navigation, accordion, images, widgets, icons, shortcodes, responsive, expand, toggle, reveal, accordian 5 5 Requires at least: 5.0 6 Tested up to: 6. 3.26 Tested up to: 6.8.1 7 7 Requires PHP: 7.4 8 Stable tag: 1.4. 38 Stable tag: 1.4.4 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 57 57 58 58 == Changelog == 59 60 = 1.4.4 = 61 * Security: Fix XSS vulnerability - Authenticated (Contributor+) XSS via shortcode 62 * Fix: Autopopulation Edge case with term autopopulation queries that return result sets that include children but not parents. 59 63 60 64 = 1.4.3 =
Note: See TracChangeset
for help on using the changeset viewer.