sedang Berlangsung

Create a shortcode on a Wordpress plugin (WC Vendors)

I have WC vendor install on my wordpress site and I need to create a new shortcode.

I need you to add a filter here so you can choose the category you want ([url removed, login to view]) (for COMMUNIQUE in this page for exmple the category is "Agence de Publicité". Son I need a list with all the categories so you see only the list of the category choose.

Here are the code :

////////////////////////////

/* list of vendors

*

* @param $atts shortcode attributs

*/

public function wcv_vendorslistsort( $atts ) {

$html = '';

extract( shortcode_atts( array(

'orderby' => 'registered',

'order' => 'ASC',

'per_page' => '12',

'columns' => '4',

'show_products' => 'no'

), $atts ) );

$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;

$offset = ( $paged - 1 ) * $per_page;

// Hook into the user query to modify the query to return users that have at least one product

if ($show_products == 'yes') add_action( 'pre_user_query', array( $this, 'vendors_with_products') );

// Get all vendors

$vendor_total_args = array (

'role' => 'vendor',

'meta_key' => 'pv_shop_slug',

'meta_value' => '',

'meta_compare' => '>',

'orderby' => $orderby,

'order' => $order,

);

if ($show_products == 'yes') $vendor_total_args['query_id'] = 'vendors_with_products';

$vendor_query = New WP_User_Query( $vendor_total_args );

$all_vendors =$vendor_query->get_results();

// Get the paged vendors

$vendor_paged_args = array (

'role' => 'vendor',

'meta_key' => 'pv_shop_slug',

'meta_value' => '',

'meta_compare' => '>',

'orderby' => $orderby,

'order' => $order,

'offset' => $offset,

'number' => $per_page,

);

if ($show_products == 'yes' ) $vendor_paged_args['query_id'] = 'vendors_with_products';

$vendor_paged_query = New WP_User_Query( $vendor_paged_args );

$paged_vendors = $vendor_paged_query->get_results();

// Pagination calcs

$total_vendors = count( $all_vendors );

$total_vendors_paged = count($paged_vendors);

$total_pages = intval( $total_vendors / $per_page ) + ( $total_vendors % $per_page );

ob_start();

// Loop through all vendors and output a simple link to their vendor pages

foreach ($paged_vendors as $vendor) {

wc_get_template( '[url removed, login to view]', array(

'shop_link' => WCV_Vendors::get_vendor_shop_page($vendor->ID),

'shop_name' => $vendor->pv_shop_name,

'vendor_id' => $vendor->ID,

'shop_description' => $vendor->pv_shop_description,

), 'wc-vendors/front/', wcv_plugin_dir . 'templates/front/' );

} // End foreach

$html .= '<ul class="wcv_vendorslist">' . ob_get_clean() . '</ul>';

if ($total_vendors > $total_vendors_paged) {

$html .= '<div class="wcv_pagination">';

$current_page = max( 1, get_query_var('paged') );

$html .= paginate_links( array(

'base' => get_pagenum_link( ) . '%_%',

'format' => 'page/%#%/',

'current' => $current_page,

'total' => $total_pages,

'prev_next' => false,

'type' => 'list',

));

$html .= '</div>';

}

return $html;

}

///////////////////////End////////////////

Right Now with this code I can create a page with a shortcode like [wcv_vendorslist show_products="no"] thas show me the list of all the vendor, but I have another table called "pv_merchant_category" and I would like to be able to create a page with a shortcode like [wcv_vendorslist show_products="no" category="Barber"] thas will show me only the list of the vendors in the "Barber" category!!

Keahlian MySQL, PHP, Hosting Web, WordPress

Lihat lebih lanjut: wordpress vendor site, want to create a new site, ul com, php create table, create a page, wordpress create linkedin plugin, wordpress create pdf certificate plugin, create plugin customize wordpress author comment notifi, wordpress create plugin, wordpress create plugin javascript, plugin wordpress create xml file, plugin wordpress create account, wordpress create subpages dropdown plugin, drop wordpress create plugin, wordpress create plugin database access

Tentang Pemberi kerja:
( 9 ulasan ) Saint Martin, Guadeloupe

ID Proyek: #8661788

Diberikan kepada:

tikumishra

Hi Hope you are doing great. I have worked on many Wordpress Plugin and Shortcode projects. I am ready to start now, if you are interested. I would just need your Code access through FTP or CPanel and we should Lagi

$30 USD dalam 1 hari
(63 Ulasan)
5.7

3 freelancer menawar pada rata-rata $23 untuk pekerjaan ini

BitLabs

Dear sir, I will complete your project asap, LIFETIME error free guarantee and provide ONE YEAR support... I have gone through your outsourced requirement "Create a shortcode on a Wordpress plugin (WC Vendors)" and Lagi

$20 USD dalam 1 hari
(63 Ulasan)
5.2
WebRss

Hi, I am a Web Designer and Developer with more than 7 year experience. I have worked as Web Design & concept Consultant. I do care for concept, typo, Fonts, color culture, neatness and User friendliness presentation Lagi

$20 USD dalam 1 hari
(7 Ulasan)
2.2