Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dernerd committed Jan 9, 2024
1 parent d922b59 commit a990284
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 208 deletions.
2 changes: 1 addition & 1 deletion includes/admin/class-mp-shortcode-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ public function enqueue_styles_scripts() {
wp_enqueue_script( 'colorbox', mp_plugin_url( 'ui/js/jquery.colorbox-min.js' ), false, MP_VERSION );

wp_enqueue_style( 'mp-select2', mp_plugin_url( 'ui/select2/select2.css' ), false, MP_VERSION );
wp_enqueue_script( 'mp-select2', mp_plugin_url( 'ui/select2/select2.min.js' ), false, MP_VERSION );
wp_enqueue_script( 'mp-select2', mp_plugin_url( 'ui/select2/select2.js' ), false, MP_VERSION );

wp_enqueue_script( 'mp-shortcode-builder', mp_plugin_url( 'includes/admin/ui/js/shortcode-builder.js', array( 'colorbox', 'chosen' ), MP_VERSION ) );
wp_localize_script( 'mp-shortcode-builder', 'MP_ShortCode_Builder', array(
Expand Down
58 changes: 23 additions & 35 deletions includes/common/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2785,41 +2785,29 @@ function mp_product_image( $echo = true, $context = 'list', $post_id = null, $si
* @param WP_Query object $custom_query
*/
function mp_products_nav( $custom_query, $echo = true ) {
$html = '';

if ( $custom_query->max_num_pages > 1 ) {
$big = 999999999;

$html = '
<nav class="mp_listings_nav">';

/* $html .= paginate_links( array(
'base' => '%_%',
'format' => '?paged=%#%',
'total' => $custom_query->max_num_pages,
'current' => max( 1, $custom_query->get( 'paged' ) ),
'prev_text' => __( 'Prev', 'mp' ),
'next_text' => __( 'Next', 'mp' ),
) ); */

//echo 'current_page:'.$custom_query->get( 'paged' );

$html .= paginate_links( array(
'base' => '?paged=%#%', //'%_%',
'format' => '', //?paged=%#%
'total' => $custom_query->max_num_pages,
'current' => max( 1, $custom_query->get( 'paged' ) ),
'show_all' => false,
'prev_next' => true,
'prev_text' => __( 'Zurück', 'mp' ),
'next_text' => __( 'Weiter', 'mp' ),
'add_args' => true,
'add_fragment' => '',
) );

$html .= '
</nav>';
}
$html = '';

// Check if $custom_query is a valid instance of WP_Query
if ( $custom_query instanceof WP_Query && $custom_query->max_num_pages > 1 ) {
$big = 999999999;

$html = '<nav class="mp_listings_nav">';

$html .= paginate_links( array(
'base' => '?paged=%#%',
'format' => '',
'total' => $custom_query->max_num_pages,
'current' => max( 1, $custom_query->get( 'paged' ) ),
'show_all' => false,
'prev_next' => true,
'prev_text' => __( 'Zurück', 'mp' ),
'next_text' => __( 'Weiter', 'mp' ),
'add_args' => true,
'add_fragment' => '',
) );

$html .= '</nav>';
}

/**
* Filter the products nav html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function display( $post_id ) {
*/
public function enqueue_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.min.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function display( $post_id ) {
* @access public
*/
public function enqueue_scripts() {
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.min.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function display( $post_id ) {
*/
public function enqueue_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.min.js' ), array( 'jquery' ), '3.4.8' );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.js' ), array( 'jquery' ), '3.4.8' );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function display( $post_id ) {
*/
public function enqueue_scripts() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.min.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
wp_enqueue_script( 'psource-field-select2', PSOURCE_Metabox::class_url( 'ui/select2/select2.js' ), array( 'jquery' ), PSOURCE_METABOX_VERSION );
}

/**
Expand Down
Loading

0 comments on commit a990284

Please sign in to comment.