| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | if ( ! defined( 'ABSPATH' ) ) { |
| 14: | exit; |
| 15: | } |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | class EPL_Advanced_Shortcode_Listing { |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | public $default_args; |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | public $atts; |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: | |
| 48: | public $attributes; |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | |
| 55: | |
| 56: | public $args; |
| 57: | |
| 58: | |
| 59: | |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | public $meta_key_price = 'property_price'; |
| 65: | |
| 66: | |
| 67: | |
| 68: | |
| 69: | |
| 70: | |
| 71: | |
| 72: | public $query_open; |
| 73: | |
| 74: | |
| 75: | |
| 76: | |
| 77: | |
| 78: | |
| 79: | |
| 80: | |
| 81: | public $shortcode = 'listing_advanced'; |
| 82: | |
| 83: | |
| 84: | |
| 85: | |
| 86: | |
| 87: | |
| 88: | |
| 89: | |
| 90: | public function __construct( $atts, $overrides = array() ) { |
| 91: | $this->atts = $atts; |
| 92: | $this->shortcode_atts(); |
| 93: | $this->override_atts( $overrides ); |
| 94: | $this->build_query(); |
| 95: | $this->set_query(); |
| 96: | } |
| 97: | |
| 98: | |
| 99: | |
| 100: | |
| 101: | |
| 102: | |
| 103: | |
| 104: | public function override_atts( $overrides ) { |
| 105: | |
| 106: | if ( ! empty( $overrides ) ) { |
| 107: | |
| 108: | foreach ( $overrides as $key => $value ) { |
| 109: | $this->set_attribute( $key, $value ); |
| 110: | } |
| 111: | } |
| 112: | } |
| 113: | |
| 114: | |
| 115: | |
| 116: | |
| 117: | |
| 118: | |
| 119: | public function get_default_post_types() { |
| 120: | |
| 121: | $property_types = epl_get_active_post_types(); |
| 122: | if ( ! empty( $property_types ) ) { |
| 123: | $property_types = array_keys( $property_types ); |
| 124: | } |
| 125: | |
| 126: | return $property_types; |
| 127: | } |
| 128: | |
| 129: | |
| 130: | |
| 131: | |
| 132: | |
| 133: | |
| 134: | |
| 135: | |
| 136: | |
| 137: | public function get_meta_key_price() { |
| 138: | |
| 139: | $post_type = $this->attributes['post_type']; |
| 140: | if ( is_array( $post_type ) && 1 === count( $post_type ) ) { |
| 141: | $post_type = reset( $post_type ); |
| 142: | } |
| 143: | |
| 144: | if ( is_string( $post_type ) && 'rental' === $post_type ) { |
| 145: | $this->meta_key_price = 'property_rent'; |
| 146: | } else { |
| 147: | $this->meta_key_price = 'property_price'; |
| 148: | } |
| 149: | |
| 150: | return $this->meta_key_price; |
| 151: | } |
| 152: | |
| 153: | |
| 154: | |
| 155: | |
| 156: | |
| 157: | |
| 158: | public function get_default_args() { |
| 159: | |
| 160: | |
| 161: | |
| 162: | |
| 163: | |
| 164: | |
| 165: | |
| 166: | |
| 167: | |
| 168: | |
| 169: | |
| 170: | |
| 171: | |
| 172: | |
| 173: | |
| 174: | |
| 175: | |
| 176: | |
| 177: | |
| 178: | |
| 179: | $this->default_args = array( |
| 180: | 'post_type' => $this->get_default_post_types(), |
| 181: | 'status' => array( 'current', 'sold', 'leased' ), |
| 182: | 'commercial_listing_type' => '', |
| 183: | 'feature' => '', |
| 184: | 'feature_id' => '', |
| 185: | 'limit' => '10', |
| 186: | 'offset' => '', |
| 187: | 'author' => '', |
| 188: | 'agent' => '', |
| 189: | 'featured' => 0, |
| 190: | 'open_house' => false, |
| 191: | 'auction' => false, |
| 192: | 'class' => 'epl-shortcode-listing', |
| 193: | 'wrap_template' => '', |
| 194: | 'template' => false, |
| 195: | 'location' => '', |
| 196: | 'location_id' => '', |
| 197: | 'tools_top' => 'off', |
| 198: | 'tools_bottom' => 'off', |
| 199: | 'sortby' => '', |
| 200: | 'orderby_clause' => '', |
| 201: | 'sort_order' => 'DESC', |
| 202: | 'query_object' => '', |
| 203: | 'pagination' => 'on', |
| 204: | 'post__in' => '', |
| 205: | 'post__not_in' => '', |
| 206: | 'instance_id' => '1', |
| 207: | ); |
| 208: | |
| 209: | return $this->default_args; |
| 210: | } |
| 211: | |
| 212: | |
| 213: | |
| 214: | |
| 215: | |
| 216: | |
| 217: | public function shortcode_atts() { |
| 218: | $this->attributes = shortcode_atts( $this->get_default_args(), $this->atts ); |
| 219: | } |
| 220: | |
| 221: | |
| 222: | |
| 223: | |
| 224: | |
| 225: | |
| 226: | |
| 227: | |
| 228: | public function set_attribute( $key, $value ) { |
| 229: | |
| 230: | if ( isset( $this->attributes[ $key ] ) ) { |
| 231: | $this->attributes[ $key ] = $value; |
| 232: | } |
| 233: | } |
| 234: | |
| 235: | |
| 236: | |
| 237: | |
| 238: | |
| 239: | |
| 240: | |
| 241: | |
| 242: | |
| 243: | public function get_attribute( $key ) { |
| 244: | |
| 245: | return isset( $this->attributes[ $key ] ) ? $this->attributes[ $key ] : null; |
| 246: | } |
| 247: | |
| 248: | |
| 249: | |
| 250: | |
| 251: | |
| 252: | |
| 253: | |
| 254: | public function set_post_type() { |
| 255: | if ( ! is_array( $this->attributes['post_type'] ) ) { |
| 256: | $this->attributes['post_type'] = |
| 257: | array_map( 'trim', explode( ',', $this->attributes['post_type'] ) ); |
| 258: | } |
| 259: | |
| 260: | |
| 261: | |
| 262: | $post_types = array(); |
| 263: | foreach ( $this->attributes['post_type'] as $post_type ) { |
| 264: | if ( ! is_string( $post_type ) || ( post_type_exists( $post_type ) && ! epl_search_can_show_post_type( $post_type ) ) ) { |
| 265: | continue; |
| 266: | } |
| 267: | $post_types[] = $post_type; |
| 268: | } |
| 269: | if ( empty( $post_types ) ) { |
| 270: | $post_types = array( 'epl_no_post_type' ); |
| 271: | } |
| 272: | $this->attributes['post_type'] = $post_types; |
| 273: | } |
| 274: | |
| 275: | |
| 276: | |
| 277: | |
| 278: | |
| 279: | |
| 280: | public function set_initial_args() { |
| 281: | |
| 282: | $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; |
| 283: | $this->args = array( |
| 284: | 'post_type' => $this->attributes['post_type'], |
| 285: | 'posts_per_page' => $this->attributes['limit'], |
| 286: | 'paged' => absint( $paged ), |
| 287: | ); |
| 288: | } |
| 289: | |
| 290: | |
| 291: | |
| 292: | |
| 293: | |
| 294: | |
| 295: | public function set_offset() { |
| 296: | |
| 297: | |
| 298: | if ( ! empty( $this->attributes['offset'] ) ) { |
| 299: | $this->args['offset'] = $this->attributes['offset']; |
| 300: | $this->attributes['pagination'] = 'off'; |
| 301: | } |
| 302: | } |
| 303: | |
| 304: | |
| 305: | |
| 306: | |
| 307: | |
| 308: | |
| 309: | public function set_post__in() { |
| 310: | if ( ! empty( $this->attributes['post__in'] ) ) { |
| 311: | $post__in = array_map( 'trim', explode( ',', $this->attributes['post__in'] ) ); |
| 312: | if ( ! empty( $post__in ) ) { |
| 313: | $this->args['post__in'] = $post__in; |
| 314: | } |
| 315: | } |
| 316: | } |
| 317: | |
| 318: | |
| 319: | |
| 320: | |
| 321: | |
| 322: | |
| 323: | public function set_post__not_in() { |
| 324: | if ( ! empty( $this->attributes['post__not_in'] ) ) { |
| 325: | $post__not_in = array_map( 'trim', explode( ',', $this->attributes['post__not_in'] ) ); |
| 326: | if ( ! empty( $post__not_in ) ) { |
| 327: | $this->args['post__not_in'] = $post__not_in; |
| 328: | } |
| 329: | } |
| 330: | } |
| 331: | |
| 332: | |
| 333: | |
| 334: | |
| 335: | |
| 336: | |
| 337: | public function process_epl_atts() { |
| 338: | |
| 339: | $this->args['meta_query'] = epl_parse_atts( $this->atts ); |
| 340: | } |
| 341: | |
| 342: | |
| 343: | |
| 344: | |
| 345: | |
| 346: | |
| 347: | public function set_author() { |
| 348: | |
| 349: | |
| 350: | if ( ! empty( $this->attributes['author'] ) ) { |
| 351: | $this->attributes['author'] = (array) $this->attributes['author']; |
| 352: | if ( is_array( $this->attributes['author'] ) ) { |
| 353: | $author_ids = array_map( 'epl_get_author_id_from_name', $this->attributes['author'] ); |
| 354: | $this->attributes['author'] = implode( ',', $author_ids ); |
| 355: | } |
| 356: | $this->args['author'] = trim( $this->attributes['author'] ); |
| 357: | } |
| 358: | } |
| 359: | |
| 360: | |
| 361: | |
| 362: | |
| 363: | |
| 364: | |
| 365: | |
| 366: | public function set_agent() { |
| 367: | |
| 368: | |
| 369: | if ( ! empty( $this->attributes['agent'] ) ) { |
| 370: | $this->attributes['agent'] = array_map( 'trim', explode( ',', $this->attributes['agent'] ) ); |
| 371: | $this->attributes['agent'] = array_filter( $this->attributes['agent'] ); |
| 372: | |
| 373: | $agent_meta_query = array( |
| 374: | 'relation' => 'OR', |
| 375: | ); |
| 376: | |
| 377: | foreach ( $this->attributes['agent'] as $single_agent ) { |
| 378: | $agent_meta_query[] = array( |
| 379: | 'key' => 'property_agent', |
| 380: | 'value' => array( $single_agent, sanitize_user( $single_agent ) ), |
| 381: | 'compare' => 'IN', |
| 382: | ); |
| 383: | $agent_meta_query[] = array( |
| 384: | 'key' => 'property_second_agent', |
| 385: | 'value' => array( $single_agent, sanitize_user( $single_agent ) ), |
| 386: | 'compare' => 'IN', |
| 387: | ); |
| 388: | |
| 389: | if ( in_array( 'commercial', $this->attributes['post_type'], true ) || |
| 390: | in_array( 'commercial_land', $this->attributes['post_type'], true ) || |
| 391: | in_array( 'business', $this->attributes['post_type'], true ) |
| 392: | ) { |
| 393: | |
| 394: | $agent_meta_query[] = array( |
| 395: | 'key' => 'property_third_agent', |
| 396: | 'value' => array( $single_agent, sanitize_user( $single_agent ) ), |
| 397: | 'compare' => 'IN', |
| 398: | ); |
| 399: | $agent_meta_query[] = array( |
| 400: | 'key' => 'property_fourth_agent', |
| 401: | 'value' => array( $single_agent, sanitize_user( $single_agent ) ), |
| 402: | 'compare' => 'IN', |
| 403: | ); |
| 404: | |
| 405: | } |
| 406: | } |
| 407: | |
| 408: | $this->args['meta_query']['agent_clause'] = $agent_meta_query; |
| 409: | } |
| 410: | } |
| 411: | |
| 412: | |
| 413: | |
| 414: | |
| 415: | |
| 416: | |
| 417: | public function set_featured() { |
| 418: | |
| 419: | |
| 420: | if ( $this->attributes['featured'] ) { |
| 421: | $this->args['meta_query']['featured_clause'] = array( |
| 422: | 'key' => 'property_featured', |
| 423: | 'value' => 'yes', |
| 424: | ); |
| 425: | } |
| 426: | } |
| 427: | |
| 428: | |
| 429: | |
| 430: | |
| 431: | |
| 432: | |
| 433: | public function set_auction() { |
| 434: | |
| 435: | |
| 436: | if ( $this->attributes['auction'] ) { |
| 437: | $this->args['meta_query']['property_authority_clause'] = array( |
| 438: | 'key' => 'property_authority', |
| 439: | 'value' => 'auction', |
| 440: | ); |
| 441: | } |
| 442: | } |
| 443: | |
| 444: | |
| 445: | |
| 446: | |
| 447: | |
| 448: | |
| 449: | public function set_open_house() { |
| 450: | |
| 451: | |
| 452: | if ( $this->attributes['open_house'] ) { |
| 453: | $this->args['meta_query']['open_house_clause'] = array( |
| 454: | 'key' => 'property_inspection_times', |
| 455: | 'value' => '', |
| 456: | 'compare' => '!=', |
| 457: | ); |
| 458: | } |
| 459: | } |
| 460: | |
| 461: | |
| 462: | |
| 463: | |
| 464: | |
| 465: | |
| 466: | public function set_location_tax_query() { |
| 467: | |
| 468: | |
| 469: | |
| 470: | if ( ! empty( $this->attributes['location'] ) ) { |
| 471: | if ( ! is_array( $this->attributes['location'] ) ) { |
| 472: | $this->attributes['location'] = array_map( 'trim', explode( ',', $this->attributes['location'] ) ); |
| 473: | |
| 474: | $this->args['tax_query']['tax_location_clause'] = array( |
| 475: | 'taxonomy' => 'location', |
| 476: | 'field' => 'slug', |
| 477: | 'terms' => $this->attributes['location'], |
| 478: | ); |
| 479: | } |
| 480: | } |
| 481: | |
| 482: | |
| 483: | if ( ! empty( $this->attributes['location_id'] ) ) { |
| 484: | if ( ! is_array( $this->attributes['location_id'] ) ) { |
| 485: | $this->attributes['location_id'] = array_map( 'trim', explode( ',', $this->attributes['location_id'] ) ); |
| 486: | |
| 487: | $this->args['tax_query']['tax_location_id_clause'] = array( |
| 488: | 'taxonomy' => 'location', |
| 489: | 'field' => 'id', |
| 490: | 'terms' => $this->attributes['location_id'], |
| 491: | ); |
| 492: | } |
| 493: | } |
| 494: | } |
| 495: | |
| 496: | |
| 497: | |
| 498: | |
| 499: | |
| 500: | |
| 501: | public function set_features_tax_query() { |
| 502: | |
| 503: | |
| 504: | |
| 505: | if ( ! empty( $this->attributes['feature'] ) ) { |
| 506: | if ( ! is_array( $this->attributes['feature'] ) ) { |
| 507: | $this->attributes['feature'] = array_map( 'trim', explode( ',', $this->attributes['feature'] ) ); |
| 508: | |
| 509: | $this->args['tax_query']['tax_feature_clause'] = array( |
| 510: | 'taxonomy' => 'tax_feature', |
| 511: | 'field' => 'slug', |
| 512: | 'terms' => $this->attributes['feature'], |
| 513: | ); |
| 514: | } |
| 515: | } |
| 516: | |
| 517: | if ( ! empty( $this->attributes['feature_id'] ) ) { |
| 518: | if ( ! is_array( $this->attributes['feature_id'] ) ) { |
| 519: | $this->attributes['feature_id'] = array_map( 'trim', explode( ',', $this->attributes['feature_id'] ) ); |
| 520: | |
| 521: | $this->args['tax_query']['tax_feature_id_clause'] = array( |
| 522: | 'taxonomy' => 'tax_feature', |
| 523: | 'field' => 'id', |
| 524: | 'terms' => $this->attributes['feature_id'], |
| 525: | ); |
| 526: | } |
| 527: | } |
| 528: | } |
| 529: | |
| 530: | |
| 531: | |
| 532: | |
| 533: | |
| 534: | |
| 535: | public function set_status() { |
| 536: | |
| 537: | if ( ! empty( $this->attributes['status'] ) ) { |
| 538: | if ( ! is_array( $this->attributes['status'] ) ) { |
| 539: | $this->attributes['status'] = array_map( 'trim', explode( ',', $this->attributes['status'] ) ); |
| 540: | |
| 541: | $this->args['meta_query']['property_status_clause'] = array( |
| 542: | 'key' => 'property_status', |
| 543: | 'value' => $this->attributes['status'], |
| 544: | 'compare' => 'IN', |
| 545: | ); |
| 546: | |
| 547: | add_filter( 'epl_sorting_options', 'epl_sorting_options_callback' ); |
| 548: | } |
| 549: | } |
| 550: | } |
| 551: | |
| 552: | |
| 553: | |
| 554: | |
| 555: | |
| 556: | |
| 557: | public function set_commercial_listing_type() { |
| 558: | |
| 559: | |
| 560: | if ( ! empty( $this->attributes['commercial_listing_type'] ) ) { |
| 561: | if ( ! is_array( $this->attributes['commercial_listing_type'] ) ) { |
| 562: | $this->attributes['commercial_listing_type'] = array_map( 'trim', explode( ',', $this->attributes['commercial_listing_type'] ) ); |
| 563: | |
| 564: | $this->args['meta_query']['property_com_listing_type_clause'] = array( |
| 565: | 'key' => 'property_com_listing_type', |
| 566: | 'value' => $this->attributes['commercial_listing_type'], |
| 567: | 'compare' => 'IN', |
| 568: | ); |
| 569: | } |
| 570: | } |
| 571: | } |
| 572: | |
| 573: | |
| 574: | |
| 575: | |
| 576: | |
| 577: | |
| 578: | public function set_orderby() { |
| 579: | |
| 580: | if ( ! empty( $this->attributes['sortby'] ) ) { |
| 581: | if ( 'price' === $this->attributes['sortby'] ) { |
| 582: | $this->args['orderby'] = 'meta_value_num'; |
| 583: | $this->args['meta_key'] = $this->get_meta_key_price(); |
| 584: | } elseif ( 'rand' === $this->attributes['sortby'] ) { |
| 585: | $this->args['orderby'] = 'rand'; |
| 586: | } elseif ( 'status' === $this->attributes['sortby'] ) { |
| 587: | $this->args['orderby'] = 'meta_value'; |
| 588: | $this->args['meta_key'] = 'property_status'; |
| 589: | } else { |
| 590: | $this->args['orderby'] = 'post_date'; |
| 591: | $this->args['order'] = 'DESC'; |
| 592: | } |
| 593: | $this->args['order'] = $this->attributes['sort_order']; |
| 594: | } |
| 595: | } |
| 596: | |
| 597: | |
| 598: | |
| 599: | |
| 600: | |
| 601: | |
| 602: | |
| 603: | |
| 604: | |
| 605: | public function set_orderby_clause() { |
| 606: | |
| 607: | |
| 608: | |
| 609: | |
| 610: | |
| 611: | if ( ! empty( $this->attributes['orderby_clause'] ) ) { |
| 612: | |
| 613: | $this->attributes['orderby_clause'] = |
| 614: | array_map( 'trim', explode( ',', $this->attributes['orderby_clause'] ) ); |
| 615: | |
| 616: | |
| 617: | if ( ! isset( $this->args['orderby'] ) || ! is_array( $this->args['orderby'] ) ) { |
| 618: | $this->args['orderby'] = array(); |
| 619: | } |
| 620: | |
| 621: | foreach ( $this->attributes['orderby_clause'] as $oc ) { |
| 622: | $oc_array = explode( '|', $oc ); |
| 623: | $clause = trim( $oc_array[0] ); |
| 624: | $order = isset( $oc_array[1] ) && 'DESC' === strtoupper( trim( $oc_array[1] ) ) ? 'DESC' : 'ASC'; |
| 625: | |
| 626: | if ( '' !== $clause ) { |
| 627: | $this->args['orderby'][ $clause ] = $order; |
| 628: | } |
| 629: | } |
| 630: | |
| 631: | unset( $this->args['order'] ); |
| 632: | } |
| 633: | |
| 634: | $this->args['instance_id'] = $this->attributes['instance_id']; |
| 635: | |
| 636: | |
| 637: | $this->args = epl_add_orderby_args( $this->args, 'shortcode', $this->shortcode ); |
| 638: | |
| 639: | $this->args = apply_filters( 'epl_shortcode_' . $this->shortcode . '_args', $this->args, $this->attributes ); |
| 640: | } |
| 641: | |
| 642: | |
| 643: | |
| 644: | |
| 645: | |
| 646: | |
| 647: | public function set_query() { |
| 648: | |
| 649: | $this->query_open = new WP_Query( $this->args ); |
| 650: | |
| 651: | if ( is_object( $this->attributes['query_object'] ) ) { |
| 652: | $this->query_open = $this->attributes['query_object']; |
| 653: | } |
| 654: | } |
| 655: | |
| 656: | |
| 657: | |
| 658: | |
| 659: | |
| 660: | |
| 661: | |
| 662: | public function get_wrap_template() { |
| 663: | |
| 664: | $wrap = str_replace( '_', '-', sanitize_key( (string) $this->attributes['wrap_template'] ) ); |
| 665: | |
| 666: | $wrap_template = '' === $wrap ? 'shortcode-listing.php' : 'shortcode-listing-' . $wrap . '.php'; |
| 667: | |
| 668: | return $wrap_template; |
| 669: | } |
| 670: | |
| 671: | |
| 672: | |
| 673: | |
| 674: | |
| 675: | |
| 676: | public function build_query() { |
| 677: | |
| 678: | $this->set_post_type(); |
| 679: | $this->set_initial_args(); |
| 680: | $this->set_offset(); |
| 681: | $this->set_post__in(); |
| 682: | $this->set_post__not_in(); |
| 683: | $this->process_epl_atts(); |
| 684: | $this->set_author(); |
| 685: | $this->set_agent(); |
| 686: | $this->set_featured(); |
| 687: | $this->set_auction(); |
| 688: | $this->set_open_house(); |
| 689: | $this->set_location_tax_query(); |
| 690: | $this->set_features_tax_query(); |
| 691: | $this->set_status(); |
| 692: | $this->set_commercial_listing_type(); |
| 693: | $this->set_orderby(); |
| 694: | $this->set_orderby_clause(); |
| 695: | } |
| 696: | |
| 697: | |
| 698: | |
| 699: | |
| 700: | |
| 701: | |
| 702: | |
| 703: | |
| 704: | public function render() { |
| 705: | $wrap_template = $this->get_wrap_template(); |
| 706: | $attributes = $this->attributes; |
| 707: | |
| 708: | $attributes['class'] = $this->get_wrapper_class(); |
| 709: | |
| 710: | ob_start(); |
| 711: | epl_get_template_part( |
| 712: | $wrap_template, |
| 713: | array( |
| 714: | 'attributes' => $attributes, |
| 715: | 'query_open' => $this->query_open, |
| 716: | ), |
| 717: | 'shortcode-listing.php' |
| 718: | ); |
| 719: | |
| 720: | return ob_get_clean(); |
| 721: | } |
| 722: | |
| 723: | |
| 724: | |
| 725: | |
| 726: | |
| 727: | |
| 728: | |
| 729: | |
| 730: | |
| 731: | |
| 732: | |
| 733: | |
| 734: | |
| 735: | public function get_wrapper_class() { |
| 736: | $classes = array( 'epl-shortcode-listing' ); |
| 737: | |
| 738: | if ( 'listing' !== $this->shortcode ) { |
| 739: | $classes[] = 'epl-shortcode-' . str_replace( '_', '-', sanitize_key( $this->shortcode ) ); |
| 740: | } |
| 741: | |
| 742: | $extra = isset( $this->attributes['class'] ) ? preg_split( '/\s+/', trim( (string) $this->attributes['class'] ) ) : array(); |
| 743: | |
| 744: | return implode( ' ', array_unique( array_filter( array_merge( $classes, (array) $extra ) ) ) ); |
| 745: | } |
| 746: | } |
| 747: | |