This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shortcode: [directorist_advanced_location ...any directorist_location attrs...] | |
* | |
* Works on a Directorist location archive where the current term slug | |
* is available via get_query_var('atbdp_location'). | |
*/ | |
add_shortcode('directorist_advanced_location', function ($atts = [], $content = null) { | |
// Keep original attributes to pass through to [directorist_location] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'directorist_related_listing_args', function ( $args ) { | |
$atbd_locs = get_the_terms(get_the_ID(), ATBDP_LOCATION); | |
$atbd_locs_ids = []; | |
if ( !empty( $atbd_locs ) ) { | |
foreach ( $atbd_locs as $atbd_loc ) { | |
$atbd_locs_ids[] = $atbd_loc->term_id; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Issue Screenshot: https://share.cleanshot.com/9Bj4SRjS | |
*/ | |
add_action( 'admin_init', 'atbdp_listing_default_type' ); | |
function atbdp_listing_default_type() { | |
$default_directory_id = 534; // add directory type id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Sidebar | |
*/ | |
add_filter( 'get_the_author_user_email', function ( $value, $user_id, $original_user_id ) { | |
if ( ! is_user_logged_in() ) { | |
return ''; | |
} | |
return $value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'atbdp_format_amount', 'modify_price_format', 10, 4 ); | |
function modify_price_format( $default, $price, $decimals, $currency_settings ){ | |
if( ! $price ) { | |
return $default; | |
} | |
return number_format_i18n( (float) $price, 0 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directorist-archive-adv-filter.directorist-advanced-filter{ | |
display: block !important; | |
} | |
.directorist-listings-header__left>a{ | |
display: none; | |
} | |
@media only screen and (min-width: 768px) { | |
.directorist-archive-contents{ | |
display: flex; | |
flex-wrap: wrap; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'atbdp_register_listing_post_type_arguments', function( $args ){ | |
$args[ 'rewrite' ][ 'slug' ] = $args[ 'rewrite' ][ 'slug' ] . "/%" . ATBDP_LOCATION . "%"; | |
return $args; | |
} ); | |
add_filter( 'post_type_link', function( $post_link, $post ){ | |
$location = get_the_terms( $post, ATBDP_LOCATION ); | |
$city = $location ? $location[0]->slug : 'city'; | |
$post_link = str_replace( '%' . ATBDP_LOCATION . '%', $city, $post_link ); | |
return $post_link; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('atbdp_listing_search_query_argument', 'directorist_updated_args_for_searchbar'); | |
function directorist_updated_args_for_searchbar($args) | |
{ | |
if (isset($_GET['q']) && !empty($_GET['q'])) : | |
$post_per_page = $args['posts_per_page']; | |
$args['posts_per_page'] = -1; | |
$args1 = $args; | |
$args1['fields'] = 'ids'; | |
$post_args1 = new WP_Query($args1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add New Column | |
add_filter( 'manage_users_columns', function( $columns ){ | |
$columns['user_vat_number'] = 'Vat Number'; | |
return $columns; | |
} ); | |
// Manipulate the column value | |
add_filter( 'manage_users_custom_column', function( $column_value, $column_name, $user_id ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------*/ | |
/* See screenshot: https://prnt.sc/eRlTV5FQLNrP */ | |
/*----------------------------------------------*/ | |
$used_free_plan = apply_filters( 'directorist_any_plan_used_once', $used_free_plan, $value->ID ); |
NewerOlder