Changeset 3821773
- Timestamp:
- 11/25/2026 12:30:17 AM (less than one hour ago)
- Location:
- directorypress/trunk
- Files:
-
- 21 edited
-
README.txt (modified) (2 diffs)
-
admin/redux-core/directorypress-settings.php (modified) (1 diff)
-
directorypress.php (modified) (2 diffs)
-
includes/class-directorypress-directorytypes.php (modified) (1 diff)
-
includes/class-directorypress-media.php (modified) (6 diffs)
-
includes/class-directorypress.php (modified) (1 diff)
-
includes/core/location/class-locations.php (modified) (1 diff)
-
includes/core/terms/functions.php (modified) (1 diff)
-
includes/directorypress-shortcodes/directorypress_listing.php (modified) (1 diff)
-
includes/directorypress-shortcodes/directorypress_main.php (modified) (9 diffs)
-
includes/directorypress_functions.php (modified) (4 diffs)
-
includes/pages/category.php (modified) (1 diff)
-
includes/pages/index.php (modified) (1 diff)
-
includes/pages/location.php (modified) (1 diff)
-
includes/pages/search.php (modified) (1 diff)
-
includes/pages/tags.php (modified) (1 diff)
-
public/partials/listing/attachment-metabox.php (modified) (1 diff)
-
public/partials/listing/wrapper.php (modified) (4 diffs)
-
public/partials/single-listing/single.php (modified) (1 diff)
-
public/partials/terms/categories/categories.php (modified) (1 diff)
-
public/shortcode-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
directorypress/trunk/README.txt
r3474986 r3821773 4 4 Tags: business directory, classified, car dealer, directories, directory listing 5 5 Requires at least: 6.0 6 Tested up to: 6.9.17 Stable tag: 3.6.2 76 Tested up to: 7.1.5 7 Stable tag: 3.6.28 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 240 240 241 241 == Changelog == 242 = 3.6.28 = 243 * Security Vulnerabilities Fixed 244 * minor fixes 245 242 246 = 3.6.27 = 243 247 * Security Vulnerabilities Fixed -
directorypress/trunk/admin/redux-core/directorypress-settings.php
r3474986 r3821773 249 249 ) ); 250 250 Redux::setSection( $opt_name, array( 251 'title' => esc_html__( 'Directory Pages', 'DIRECTORYPRESS' ), 252 'desc' => '', 253 'id' => 'directory-pages-section', 254 'subsection' => true, 255 'fields' => array( 256 array( 257 'id' => 'directory_type_pages', 258 'type' => 'select', 259 'multi' => true, 260 'title' => esc_html__( 'Main Directory pages', 'DIRECTORYPRESS' ), 261 'desc' => esc_html__( 'select your Directory page/pages, System can detect pages by default but this selection will improve performance', 'DIRECTORYPRESS' ), 262 'options' => $all_pages, 263 'default' => array() 264 ), 265 array( 266 'id' => 'directory_single_listing_pages', 267 'type' => 'select', 268 'multi' => true, 269 'title' => esc_html__( 'Single listing pages', 'DIRECTORYPRESS' ), 270 'desc' => esc_html__( 'select your single listing page/pages, System can detect pages by default but this selection will improve performance', 'DIRECTORYPRESS' ), 271 'options' => $all_pages, 272 'default' => array() 273 ), 274 array( 275 'id' => 'directory_submit_listing_pages', 276 'type' => 'select', 277 'multi' => true, 278 'title' => esc_html__( 'Submit listing pages', 'DIRECTORYPRESS' ), 279 'desc' => esc_html__( 'select your Submit listing page/pages, System can detect pages by default but this selection will improve performance', 'DIRECTORYPRESS' ), 280 'options' => $all_pages, 281 'default' => array() 282 ) 283 ), 284 ) ); 285 Redux::setSection( $opt_name, array( 251 286 'title' => esc_html__( 'User Verification', 'DIRECTORYPRESS' ), 252 287 'desc' => '', -
directorypress/trunk/directorypress.php
r3474986 r3821773 4 4 * Plugin URI: https://designinvento.net/downloads/directorypress-wordpress-directory-plugin/ 5 5 * Description: DirectoryPress offers ultimate functionality for business directory listing, classified ads listing. Real estate, pets directory, yellow pages, automobile or any kind of directory. 6 * Version: 3.6.2 76 * Version: 3.6.28 7 7 * Author: Designinvento 8 8 * Author URI: https://designinvento.net/ … … 21 21 // ================== 22 22 23 define( 'DIRECTORYPRESS_VERSION', '3.6.2 7' );23 define( 'DIRECTORYPRESS_VERSION', '3.6.28' ); 24 24 25 25 $DIRECTORYPRESS_ADIMN_SETTINGS = get_option('directorypress_admin_settings'); -
directorypress/trunk/includes/class-directorypress-directorytypes.php
r3184665 r3821773 249 249 foreach ($directorypress_object->directorypress_all_archive_pages AS $index_page) { 250 250 251 $page_obj = get_post($index_page['id']);251 $page_obj = (is_object($index_page))? $index_page: get_post($index_page['id']); 252 252 if (preg_match_all('/'.$pattern.'/s', $page_obj->post_content, $matches) && array_key_exists(2, $matches)) { 253 253 foreach ($matches[2] AS $key=>$shortcode) { -
directorypress/trunk/includes/class-directorypress-media.php
r3239654 r3821773 110 110 111 111 // Set an array containing a list of acceptable formats 112 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png' );112 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/webp', 'image/avif'); 113 113 114 114 // If the uploaded file is the right format … … 150 150 } 151 151 } else{ // wrong file type 152 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif or png).', 'DIRECTORYPRESS');152 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif, avif, webp or png).', 'DIRECTORYPRESS'); 153 153 } 154 154 … … 168 168 $arr_file_type = wp_check_filetype(basename($_FILES['browse_file_clogo']['name'])); 169 169 $uploaded_file_type = $arr_file_type['type']; 170 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png' );170 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/webp', 'image/avif'); 171 171 172 172 if (in_array($uploaded_file_type, $allowed_file_types)) { … … 199 199 $result['error_msg'] = 'There was a problem with your upload: ' . $uploaded_file['error']; 200 200 } else // wrong file type 201 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif or png).', 'DIRECTORYPRESS');201 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif, avif, webp or png).', 'DIRECTORYPRESS'); 202 202 //} else 203 203 //$result['error_msg'] = esc_html__('Can not upload images for this listing.', 'DIRECTORYPRESS'); … … 222 222 223 223 // Set an array containing a list of acceptable formats 224 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png' );224 $allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/webp', 'image/avif'); 225 225 226 226 // If the uploaded file is the right format … … 261 261 $result['error_msg'] = 'There was a problem with your upload: ' . $uploaded_file['error']; 262 262 } else // wrong file type 263 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif or png).', 'DIRECTORYPRESS');263 $result['error_msg'] = esc_html__('Please upload only image files (jpg, gif, avif, webp or png).', 'DIRECTORYPRESS'); 264 264 //} else 265 265 //$result['error_msg'] = esc_html__('Can not upload images for this listing.', 'DIRECTORYPRESS'); -
directorypress/trunk/includes/class-directorypress.php
r3474986 r3821773 60 60 $this->version = DIRECTORYPRESS_VERSION; 61 61 }else{ 62 $this->version = '3.6.2 7';62 $this->version = '3.6.28'; 63 63 } 64 64 $this->plugin_name = 'directorypress'; -
directorypress/trunk/includes/core/location/class-locations.php
r2792202 r3821773 55 55 $result_chain = array(); 56 56 foreach ($chain AS $location_key=>$location) { 57 if ($locations_depths_array[$location_key]->in_address_line) 57 if (($locations_depths_array[$location_key] ?? null)?->in_address_line) { 58 //if ($locations_depths_array[$location_key]?->in_address_line) 58 59 $result_chain[] = $location; 60 } 59 61 } 60 62 -
directorypress/trunk/includes/core/terms/functions.php
r3184665 r3821773 397 397 $icon_type = 'font'; 398 398 if(!empty(get_listing_category_color($term->term_id))){ 399 $icon_color = $cat_color_set;399 $icon_color = get_listing_category_color($term->term_id); 400 400 }else{ 401 401 global $DIRECTORYPRESS_ADIMN_SETTINGS; -
directorypress/trunk/includes/directorypress-shortcodes/directorypress_listing.php
r3184665 r3821773 83 83 if ($shortcode_atts['include_get_params']) { 84 84 array_walk_recursive($_GET, 'sanitize_text_field'); 85 // Remove keys that must NOT be overridable by public GET params (patchstack LFI fix) 86 unset($_GET['template']); 85 87 $this->args = array_merge($this->args, $_GET); 86 88 } -
directorypress/trunk/includes/directorypress-shortcodes/directorypress_main.php
r3474986 r3821773 28 28 public $category; 29 29 public $location; 30 public $tag; 30 31 31 32 public function init($shortcode_atts = array(), $shortcode = 'directorypress-main') { … … 318 319 319 320 do_action('archive_category_page', $this, $search_args, $shortcode_atts, $map_args); 320 //add_action('wp_head', array($this, 'insert_opengraph_metadat'), -10); 321 322 // replace the default WordPress canonical URL function with your own 323 add_action('wp_head', array($this, 'rel_canonical_with_custom_tag_override')); 324 //add_filter( 'rank_math/frontend/canonical', function( $canonical ) { 325 //return get_permalink($this->listing->post->ID); 326 //}); 321 add_filter( 'rank_math/frontend/canonical', array($this, 'rankmath_canonical') ); 322 add_action('wp_head', array($this, 'rankmath_data'), -10); 327 323 328 324 } elseif (get_query_var('location-directorypress')) { 329 325 330 326 do_action('archive_location_page', $this, $search_args, $shortcode_atts, $map_args); 327 add_filter( 'rank_math/frontend/canonical', array($this, 'rankmath_canonical') ); 331 328 332 329 } elseif (get_query_var('tag-directorypress')) { 333 330 334 331 do_action('archive_tags_page', $this, $search_args, $shortcode_atts, $map_args); 332 add_filter( 'rank_math/frontend/canonical', array($this, 'rankmath_canonical') ); 333 add_action('wp_head', array($this, 'rankmath_data'), -10); 335 334 336 335 } elseif ($directorypress_object->action == 'myfavourites') { … … 341 340 do_action('archive_index_page', $this, $search_args, $shortcode_atts, $map_args, $shortcode); 342 341 } 342 343 343 344 344 $this->args['directorytypes'] = $directorypress_object->current_directorytype->id; … … 528 528 529 529 public function page_title($title, $separator = '|') { 530 531 if ($ category_object= directorypress_get_term_by_path(get_query_var('category-directorypress'))) {532 $rm_seo_title = get_term_meta( $ category_object->term_id, 'rank_math_title', true );530 //$tt = 'hello'; 531 if ($term = directorypress_get_term_by_path(get_query_var('category-directorypress'))) { 532 $rm_seo_title = get_term_meta( $term->term_id, 'rank_math_title', true ); 533 533 if($rm_seo_title && !empty($rm_seo_title)){ 534 534 $title = $rm_seo_title; 535 535 }else{ 536 $title = $ category_object->name . ' ' . $separator . ' ';536 $title = $term->name . ' ' . $separator . ' '; 537 537 if (directorypress_wpml_supported_settings('directorypress_directory_title')){ 538 538 $title .= directorypress_wpml_supported_settings('directorypress_directory_title'); … … 541 541 } 542 542 } 543 }else {544 $rm_seo_title = get_ post_meta( $this->listing->post->ID, 'rank_math_title', true );543 }elseif ($term = directorypress_get_term_by_path(get_query_var('location-directorypress'))) { 544 $rm_seo_title = get_term_meta( $term->term_id, 'rank_math_title', true ); 545 545 if($rm_seo_title && !empty($rm_seo_title)){ 546 546 $title = $rm_seo_title; 547 547 }else{ 548 if ($this->getPageTitle()){ 549 $title = $this->getPageTitle() . ' ' . $separator . ' '; 550 } 548 $title = $term->name . ' ' . $separator . ' '; 551 549 if (directorypress_wpml_supported_settings('directorypress_directory_title')){ 552 550 $title .= directorypress_wpml_supported_settings('directorypress_directory_title'); … … 555 553 } 556 554 } 555 }elseif ($term = get_term_by('slug', get_query_var('tag-directorypress'), DIRECTORYPRESS_TAGS_TAX)) { 556 $rm_seo_title = get_term_meta( $term->term_id, 'rank_math_title', true ); 557 if($rm_seo_title && !empty($rm_seo_title)){ 558 $title = $rm_seo_title; 559 }else{ 560 $title = $term->name . ' ' . $separator . ' '; 561 if (directorypress_wpml_supported_settings('directorypress_directory_title')){ 562 $title .= directorypress_wpml_supported_settings('directorypress_directory_title'); 563 }else{ 564 $title .= get_option('blogname'); 565 } 566 } 567 }else{ 568 569 //$rm_seo_title = get_post_meta( $this->listing->post->ID, 'rank_math_title', true ); 570 if(!is_null($this->listing) && get_post_meta( $this->listing->post->ID, 'rank_math_title', true ) && !empty(get_post_meta( $this->listing->post->ID, 'rank_math_title', true ))){ 571 $title = get_post_meta( $this->listing->post->ID, 'rank_math_title', true ); 572 }else{ 573 if ($this->getPageTitle()){ 574 $title = $this->getPageTitle() . ' ' . $separator . ' '; 575 } 576 if (directorypress_wpml_supported_settings('directorypress_directory_title')){ 577 $title .= directorypress_wpml_supported_settings('directorypress_directory_title'); 578 }else{ 579 $title .= get_option('blogname'); 580 } 581 } 557 582 } 558 583 … … 564 589 echo '<link rel="canonical" href="' . esc_url(get_permalink($this->listing->post->ID)) . '" />'; 565 590 add_filter('rank_math/frontend/canonical', array($this, 'opengraph_url'),11); 591 } 592 593 // rankmath canonical URL 594 public function rankmath_canonical() { 595 if ($term = directorypress_get_term_by_path(get_query_var('location-directorypress'))) { 596 $link = get_term_link( $term ); 597 return $link; 598 }elseif ($term = directorypress_get_term_by_path(get_query_var('category-directorypress'))) { 599 $link = get_term_link( $term ); 600 return $link; 601 }elseif ($term = get_term_by('slug', get_query_var('tag-directorypress'), DIRECTORYPRESS_TAGS_TAX)) { 602 $link = get_term_link( $term ); 603 return $link; 604 } 566 605 } 567 606 … … 600 639 remove_action( 'rank_math/head', 'rank_math_canonical' ); 601 640 } 602 /*public rankmath_data($robots){ 603 $meta_description = get_post_meta( $this->listing->post->ID, '_rank_math_description', true ); 604 //if ( is_single() && has_category( 'my-category', get_the_ID() ) ) { 605 $robots['index'] = 'noindex'; // Add 'noindex' to the robots meta 606 //} 607 return $robots; 608 }*/ 641 public function rankmath_data(){ 642 add_filter('rank_math/frontend/title', array($this, 'opengraph_title')); 643 add_filter('rank_math/frontend/description', array($this, 'rankmath_description')); 644 if($this->is_single){ 645 add_filter('rank_math/opengraph/url', array($this, 'opengraph_url')); 646 } 647 add_filter('rank_math/frontend/robots', array($this, 'rankmath_robots')); 648 } 609 649 610 650 public function opengraph_title() { 611 651 612 652 global $DIRECTORYPRESS_ADIMN_SETTINGS; 613 if ($ category_object= directorypress_get_term_by_path(get_query_var('category-directorypress'))) {614 $rm_seo_title = get_term_meta( $ category_object->term_id, 'rank_math_title', true );653 if ($term = directorypress_get_term_by_path(get_query_var('category-directorypress'))) { 654 $rm_seo_title = get_term_meta( $term->term_id, 'rank_math_title', true ); 615 655 if($rm_seo_title && !empty($rm_seo_title)){ 616 656 return $rm_seo_title; 617 657 }else{ 618 return $category_object->name; 658 return $term->name; 659 } 660 }elseif ($term = directorypress_get_term_by_path(get_query_var('location-directorypress'))) { 661 $rm_seo_title = get_term_meta( $term->term_id, 'title', true ); 662 if($rm_seo_title && !empty($rm_seo_title)){ 663 return $rm_seo_title; 664 }else{ 665 return $term->name; 666 } 667 }elseif ($term = get_term_by('slug', get_query_var('tag-directorypress'), DIRECTORYPRESS_TAGS_TAX)) { 668 $rm_seo_title = get_term_meta( $term->term_id, 'title', true ); 669 if($rm_seo_title && !empty($rm_seo_title)){ 670 return $rm_seo_title; 671 }else{ 672 return $term->name; 619 673 } 620 674 }else{ … … 639 693 } 640 694 641 public function rankmath_description() { 642 if ($category_object = directorypress_get_term_by_path(get_query_var('category-directorypress'))) { 643 $desc = RankMath\Post::get_meta( 'description', $category_object->term_id ); 695 public function rankmath_description($description = '') { 696 if ($term = directorypress_get_term_by_path(get_query_var('category-directorypress')) || $term = directorypress_get_term_by_path(get_query_var('location-directorypress')) || $term = get_term_by('slug', get_query_var('tag-directorypress'), DIRECTORYPRESS_TAGS_TAX)) { 697 if(is_object($term)){ 698 $desc = RankMath\Post::get_meta( 'description', $term->term_id ); 699 }else{ 700 $desc = ''; 701 } 644 702 }else{ 645 703 $desc = RankMath\Post::get_meta( 'description', $this->listing->post->ID ); -
directorypress/trunk/includes/directorypress_functions.php
r3474986 r3821773 347 347 } 348 348 function directorypress_get_system_pages() { 349 global $wpdb, $post; 350 //$all_posts = $wpdb->get_results("SELECT post_id,meta_value FROM {$wpdb->postmeta} WHERE (meta_key = '_elementor_data')"); 351 //if(!directorypress_is_archive_page($post)) 352 $flat_index_pages = $wpdb->get_results("SELECT ID AS id, post_name AS slug FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_MAIN_SHORTCODE . "]%') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 353 $custom_index_pages = $wpdb->get_results("SELECT ID AS id, post_name AS slug FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_MAIN_SHORTCODE . " %') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 354 //$el_index_pages = $wpdb->get_results("SELECT ID AS id, post_name AS slug FROM {$wpdb->posts} WHERE (post_content LIKE '%el_archive_page%') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 355 $index_pages = array_merge($flat_index_pages, $custom_index_pages); 349 global $wpdb, $post, $DIRECTORYPRESS_ADIMN_SETTINGS; 350 $flat_index_pages = $wpdb->get_results("SELECT ID AS id, post_name AS slug FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_MAIN_SHORTCODE . "]%') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 351 $custom_index_pages = $wpdb->get_results("SELECT ID AS id, post_name AS slug FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_MAIN_SHORTCODE . " %') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 352 $index_pages = array_merge($flat_index_pages, $custom_index_pages); 356 353 357 354 // adapted for WPML … … 370 367 $index_pages = array_unique($index_pages, SORT_REGULAR); 371 368 $index_pages = apply_filters("directorypress_get_all_directory_pages", $index_pages); 372 369 //var_dump($index_pages); 373 370 return $index_pages; 374 371 } … … 376 373 377 374 function directorypress_get_all_listing_related_pages() { 378 global $wpdb, $directorypress_object; 379 380 $flat_listing_pages = $wpdb->get_results("SELECT ID AS id FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_LISTING_SHORTCODE . "]%' OR post_content LIKE '%[directorypress-listing]%') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 381 $custom_listing_pages = $wpdb->get_results("SELECT ID AS id FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_LISTING_SHORTCODE . " %' OR post_content LIKE '%[directorypress-listing %') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 382 $pages = array_merge($flat_listing_pages, $custom_listing_pages); 375 global $wpdb, $directorypress_object, $DIRECTORYPRESS_ADIMN_SETTINGS; 376 $flat_listing_pages = $wpdb->get_results("SELECT ID AS id FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_LISTING_SHORTCODE . "]%' OR post_content LIKE '%[directorypress-listing]%') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 377 $custom_listing_pages = $wpdb->get_results("SELECT ID AS id FROM {$wpdb->posts} WHERE (post_content LIKE '%[" . DIRECTORYPRESS_LISTING_SHORTCODE . " %' OR post_content LIKE '%[directorypress-listing %') AND post_status = 'publish' AND post_type = 'page'", ARRAY_A); 378 $pages = array_merge($flat_listing_pages, $custom_listing_pages); 383 379 384 380 // adapted for WPML … … 400 396 $shortcodes = array(DIRECTORYPRESS_LISTING_SHORTCODE, 'directorypress-listing'); 401 397 foreach ($pages AS $page_id) { 402 $page_id = $page_id['id']; 398 if(is_object($page_id)){ 399 $page_id = $page_id->ID; 400 }else{ 401 $page_id = $page_id['id']; 402 } 403 403 $pattern = get_shortcode_regex($shortcodes); 404 404 if (preg_match_all('/'.$pattern.'/s', get_post($page_id)->post_content, $matches) && array_key_exists(2, $matches)) { -
directorypress/trunk/includes/pages/category.php
r3184665 r3821773 31 31 32 32 array_walk_recursive($_GET, 'sanitize_text_field'); 33 // Remove keys that must NOT be overridable by public GET params 34 unset($_GET['template']); 33 35 $public_handler->args = array_merge($default_orderby_args, $_GET); 34 36 -
directorypress/trunk/includes/pages/index.php
r2914184 r3821773 30 30 31 31 array_walk_recursive($_GET, 'sanitize_text_field'); 32 // Remove keys that must NOT be overridable by public GET params 33 unset($_GET['template']); 32 34 $public_handler->args = array_merge($default_orderby_args, $_GET); 33 35 -
directorypress/trunk/includes/pages/location.php
r3184665 r3821773 37 37 38 38 array_walk_recursive($_GET, 'sanitize_text_field'); 39 // Remove keys that must NOT be overridable by public GET params 40 unset($_GET['template']); 39 41 $public_handler->args = array_merge($default_orderby_args, $_GET); 40 42 -
directorypress/trunk/includes/pages/search.php
r3184665 r3821773 33 33 34 34 array_walk_recursive($_GET, 'sanitize_text_field'); 35 // Remove keys that must NOT be overridable by public GET params 36 unset($_GET['template']); 35 37 $public_handler->args = array_merge($default_orderby_args, $_GET); 36 38 -
directorypress/trunk/includes/pages/tags.php
r3184665 r3821773 31 31 32 32 array_walk_recursive($_GET, 'sanitize_text_field'); 33 // Remove keys that must NOT be overridable by public GET params 34 unset($_GET['template']); 33 35 $public_handler->args = array_merge($default_orderby_args, $_GET); 34 36 -
directorypress/trunk/public/partials/listing/attachment-metabox.php
r3190378 r3821773 162 162 <i class="pacz-icon-photo"></i> 163 163 <span class="drophere"><?php esc_html_e("Drag and Drop Images Here", "DIRECTORYPRESS"); ?></span> 164 <span class="drophere-desc-text"><?php esc_html_e("Photos must be JPEG or PNGformat with ideal Aspect Ratio 16:9 ", "DIRECTORYPRESS"); ?></span>164 <span class="drophere-desc-text"><?php esc_html_e("Photos must be JPEG, PNG, AVIF or Webp format with ideal Aspect Ratio 16:9 ", "DIRECTORYPRESS"); ?></span> 165 165 <button class="directorypress-upload-item-button gallary_images btn btn-primary"><?php esc_html_e("Browse Files", "DIRECTORYPRESS"); ?></button> 166 166 <input type="file" name="browse_file" multiple /> -
directorypress/trunk/public/partials/listing/wrapper.php
r3209533 r3821773 25 25 } 26 26 27 $grid_wrapper_margin = ($listing_style_to_show == 'show_grid_style')? 'style="margin-left:-'. $grid_padding .'px;margin-right: -'. $grid_padding .'px;"' : ''; 28 $data_unique_id = ($DIRECTORYPRESS_ADIMN_SETTINGS['directorypress_grid_masonry_display'])? 'data-uniqid="'. $public_handler->hash .'"' :''; 27 $grid_padding_safe = absint( $grid_padding ); 28 $grid_margin_bottom_safe = absint( $directorypress_grid_margin_bottom ); 29 $grid_wrapper_margin = ($listing_style_to_show == 'show_grid_style') ? sprintf('style="margin-left:-%dpx;margin-right:-%dpx;"', $grid_padding_safe, $grid_padding_safe) : ''; 30 $data_unique_id = ($DIRECTORYPRESS_ADIMN_SETTINGS['directorypress_grid_masonry_display']) ? 'data-uniqid="'. esc_attr( $public_handler->hash ) .'"' : ''; 29 31 $slick_attrs = ''; 30 if ($public_handler->args['scroll']){ 31 $slider_arrow_position = (isset($public_handler->args['slider_arrow_position']))? $public_handler->args['slider_arrow_position']: 'absolute'; 32 $slider_arrow_icon_pre = (!empty($public_handler->args['slider_arrow_icon_pre']))? $public_handler->args['slider_arrow_icon_pre'] : 'fas fa-angle-left'; 33 $slider_arrow_icon_next = (!empty($public_handler->args['slider_arrow_icon_next']))? $public_handler->args['slider_arrow_icon_next'] : 'fas fa-angle-right'; 32 if ( $public_handler->args['scroll'] ) { 33 // Sanitize slider config — wp_kses_post() passes bare data-* attr fragments through unchanged 34 $slider_arrow_position = ( isset( $public_handler->args['slider_arrow_position'] ) ) ? preg_replace( '/[^a-z\-]/i', '', $public_handler->args['slider_arrow_position'] ) : 'absolute'; 35 $slider_arrow_icon_pre = ( ! empty( $public_handler->args['slider_arrow_icon_pre'] ) ) ? trim( $public_handler->args['slider_arrow_icon_pre'] ) : 'fas fa-angle-left'; 36 $slider_arrow_icon_next = ( ! empty( $public_handler->args['slider_arrow_icon_next'] ) ) ? trim( $public_handler->args['slider_arrow_icon_next'] ) : 'fas fa-angle-right'; 37 $desktop_items = absint( $public_handler->args['desktop_items'] ); 38 $tab_items = absint( $public_handler->args['tab_items'] ); 39 $mobile_items = absint( $public_handler->args['mobile_items'] ); 40 $autoplay_speed = absint( $public_handler->args['autoplay_speed'] ); 41 $loop = (bool) $public_handler->args['loop']; 42 $owl_nav = (bool) $public_handler->args['owl_nav']; 43 $autoplay = (bool) $public_handler->args['autoplay']; 34 44 35 $slick_attrs = 'data-items="'. $public_handler->args['desktop_items'].'"';36 $slick_attrs .= 'data-items-tablet="'. $ public_handler->args['tab_items'].'"';37 $slick_attrs .= 'data-items-mobile="'. $ public_handler->args['mobile_items'].'"';45 $slick_attrs = 'data-items="'. $desktop_items .'"'; 46 $slick_attrs .= 'data-items-tablet="'. $tab_items .'"'; 47 $slick_attrs .= 'data-items-mobile="'. $mobile_items .'"'; 38 48 $slick_attrs .= 'data-slide-to-scroll="1"'; 39 49 $slick_attrs .= 'data-slide-speed="1000"'; 40 $slick_attrs .= ($public_handler->args['autoplay'])? 'data-autoplay="true"' : 'data-autoplay="false"';50 $slick_attrs .= $autoplay ? 'data-autoplay="true"' : 'data-autoplay="false"'; 41 51 $slick_attrs .= 'data-center-padding=""'; 42 52 $slick_attrs .= 'data-center="false"'; 43 $slick_attrs .= 'data-autoplay-speed="'. $ public_handler->args['autoplay_speed'].'"';44 $slick_attrs .= ($public_handler->args['loop'])? 'data-loop="true"' : 'data-loop="false"';45 $slick_attrs .= 'data-list-margin="'. $grid_padding.'"';46 $slick_attrs .= ($public_handler->args['owl_nav'])? 'data-arrow="true"': 'data-arrow="false"';47 $slick_attrs .= 'data-prev-arrow="'. $slider_arrow_icon_pre.'"';48 $slick_attrs .= 'data-next-arrow="'. $slider_arrow_icon_next.'"';49 $slick_attrs .= 'data-arrow-pos tion ="'. $slider_arrow_position.'"';53 $slick_attrs .= 'data-autoplay-speed="'. $autoplay_speed .'"'; 54 $slick_attrs .= $loop ? 'data-loop="true"' : 'data-loop="false"'; 55 $slick_attrs .= 'data-list-margin="'. $grid_padding_safe .'"'; 56 $slick_attrs .= $owl_nav ? 'data-arrow="true"' : 'data-arrow="false"'; 57 $slick_attrs .= 'data-prev-arrow="'. esc_attr( $slider_arrow_icon_pre ) .'"'; 58 $slick_attrs .= 'data-next-arrow="'. esc_attr( $slider_arrow_icon_next ) .'"'; 59 $slick_attrs .= 'data-arrow-position="'. esc_attr( $slider_arrow_position ) .'"'; 50 60 } 51 61 … … 60 70 61 71 if ($public_handler->listings){ 62 echo '<div id="listing-block-'. esc_attr($public_handler->hash) .'" class="directorypress-listings-block-content '. esc_attr($carousel) .' '. esc_attr($masonry_wrapper) .' clearfix" '. wp_kses_post($grid_wrapper_margin) .' '. wp_kses_post($data_unique_id) .' '. wp_kses_post($data_masonry) .'>';72 echo '<div id="listing-block-'. esc_attr($public_handler->hash) .'" class="directorypress-listings-block-content '. esc_attr($carousel) .' '. esc_attr($masonry_wrapper) .' clearfix" '. esc_attr($grid_wrapper_margin) .' '. esc_attr($data_unique_id) .' '. esc_attr($data_masonry) .'>'; 63 73 if(!empty($public_handler->args['custom_category_link'])){ 64 74 echo '<div class="custom-category-link">'; … … 67 77 } 68 78 if ($public_handler->args['scroll']){ 69 echo '<div class="dp-slick-carousel owl-on-grid" '. wp_kses_post($slick_attrs) .'>';79 echo '<div class="dp-slick-carousel owl-on-grid" '. esc_attr($slick_attrs) .'>'; 70 80 } 71 81 if($listing_style_to_show == 'show_list_style'){ … … 86 96 $listing_classes .= ($public_handler->listings[get_the_ID()]->package->has_sticky)? ' directorypress-has_sticky': ''; 87 97 88 $listing_inline_css = ($listing_style_to_show == 'show_grid_style') ? 'style="padding-left:'. $grid_padding .'px;padding-right:'. $grid_padding .'px; margin-bottom:'. $directorypress_grid_margin_bottom .'px;"': '';98 $listing_inline_css = ($listing_style_to_show == 'show_grid_style') ? sprintf('style="padding-left:%dpx;padding-right:%dpx;margin-bottom:%dpx;"', $grid_padding_safe, $grid_padding_safe, $grid_margin_bottom_safe) : ''; 89 99 90 100 echo '<article id="post-'. esc_attr(get_the_ID()) .'" class="row directorypress-listing clearfix '. esc_attr($listing_classes) .'" '. wp_kses_post($listing_inline_css) .'>'; -
directorypress/trunk/public/partials/single-listing/single.php
r2914184 r3821773 4 4 $id = uniqid(); 5 5 $field_ids = $wpdb->get_results('SELECT id, type, slug, group_id FROM '.$wpdb->prefix.'directorypress_fields'); 6 7 6 ?> 8 7 -
directorypress/trunk/public/partials/terms/categories/categories.php
r2792202 r3821773 2 2 3 3 global $DIRECTORYPRESS_ADIMN_SETTINGS,$directorypress_object; 4 $slider_arrow_position = (isset($instance->slider_arrow_position))? $instance->slider_arrow_position: 'absolute'; 5 $slider_arrow_icon_pre = (!empty($instance->slider_arrow_icon_pre))? $instance->slider_arrow_icon_pre : 'fas fa-angle-left'; 6 $slider_arrow_icon_next = (!empty($instance->slider_arrow_icon_next))? $instance->slider_arrow_icon_next : 'fas fa-angle-right'; 4 // Sanitize slider config — wp_kses_post() passes bare data-* attr fragments through unchanged 5 $slider_arrow_position = (isset($instance->slider_arrow_position) && !empty($instance->slider_arrow_position)) ? preg_replace('/[^a-z\-]/i', '', $instance->slider_arrow_position) : 'absolute'; 6 $slider_arrow_icon_pre = (!empty($instance->slider_arrow_icon_pre)) ? trim($instance->slider_arrow_icon_pre) : 'fas fa-angle-left'; 7 $slider_arrow_icon_next = (!empty($instance->slider_arrow_icon_next)) ? trim($instance->slider_arrow_icon_next) : 'fas fa-angle-right'; 7 8 8 $slick_attrs = 'data-items="'. $instance->desktop_items.'"';9 $slick_attrs .= 'data-items-tablet="'. $instance->tab_items.'"';10 $slick_attrs .= 'data-items-mobile="'. $instance->mobile_items.'"';9 $slick_attrs = 'data-items="'. absint( $instance->desktop_items ) .'"'; 10 $slick_attrs .= 'data-items-tablet="'. absint( $instance->tab_items ) .'"'; 11 $slick_attrs .= 'data-items-mobile="'. absint( $instance->mobile_items ) .'"'; 11 12 $slick_attrs .= 'data-slide-to-scroll="1"'; 12 13 $slick_attrs .= 'data-slide-speed="1000"'; 13 $slick_attrs .= ( $instance->autoplay)? 'data-autoplay="true"' : 'data-autoplay="false"';14 $slick_attrs .= (bool) $instance->autoplay ? 'data-autoplay="true"' : 'data-autoplay="false"'; 14 15 $slick_attrs .= 'data-center-padding=""'; 15 16 $slick_attrs .= 'data-center="false"'; 16 $slick_attrs .= 'data-autoplay-speed="'. $instance->autoplay_speed.'"';17 $slick_attrs .= ( $instance->loop)? 'data-loop="true"' : 'data-loop="false"';18 $slick_attrs .= 'data-list-margin="'. $instance->gutter.'"';19 $slick_attrs .= ( $instance->owl_nav)? 'data-arrow="true"': 'data-arrow="false"';20 $slick_attrs .= 'data-prev-arrow="'. $slider_arrow_icon_pre.'"';21 $slick_attrs .= 'data-next-arrow="'. $slider_arrow_icon_next.'"';22 $slick_attrs .= 'data-arrow-pos tion ="'. $slider_arrow_position.'"';17 $slick_attrs .= 'data-autoplay-speed="'. absint( $instance->autoplay_speed ) .'"'; 18 $slick_attrs .= (bool) $instance->loop ? 'data-loop="true"' : 'data-loop="false"'; 19 $slick_attrs .= 'data-list-margin="'. absint( $instance->gutter ) .'"'; 20 $slick_attrs .= (bool) $instance->owl_nav ? 'data-arrow="true"' : 'data-arrow="false"'; 21 $slick_attrs .= 'data-prev-arrow="'. esc_attr( $slider_arrow_icon_pre ) .'"'; 22 $slick_attrs .= 'data-next-arrow="'. esc_attr( $slider_arrow_icon_next ) .'"'; 23 $slick_attrs .= 'data-arrow-position="'. esc_attr( $slider_arrow_position ) .'"'; 23 24 $instance->slick_attrs = $slick_attrs; 24 25 -
directorypress/trunk/public/shortcode-functions.php
r2802908 r3821773 21 21 22 22 array_walk_recursive($_GET, 'sanitize_text_field'); 23 // Remove keys that must NOT be overridable by public GET params 24 unset($_GET['template']); 23 25 $public_handler->args = array_merge($default_orderby_args, $_GET); 24 26
Note:
See TracChangeset
for help on using the changeset viewer.