Astra_Ext_Blog_Pro_Markup::blog_js_localize( array $localize )
Infinite Posts Show on scroll
Description
Parameters
- $localize
-
(array) (Required) JS localize variables.
Return
(array)
Source
File: addons/blog-pro/classes/class-astra-ext-blog-pro-markup.php
public function blog_js_localize( $localize ) { global $wp_query; $pagination_enabled = apply_filters( 'astra_pagination_enabled', true ); $blog_masonry = astra_get_option( 'blog-masonry' ); $blog_pagination = ( $pagination_enabled ) ? astra_get_option( 'blog-pagination' ) : ''; $blog_infinite_scroll_event = astra_get_option( 'blog-infinite-scroll-event' ); $blog_grid = astra_get_option( 'blog-grid' ); $blog_grid_layout = astra_get_option( 'blog-grid-layout' ); $blog_layout = astra_get_option( 'blog-layout' ); $grid_layout = ( 'blog-layout-1' == $blog_layout ) ? $blog_grid : $blog_grid_layout; $localize['edit_post_url'] = admin_url( 'post.php?post={{id}}&action=edit' ); $localize['ajax_url'] = admin_url( 'admin-ajax.php' ); $localize['infinite_count'] = 2; $localize['infinite_total'] = $wp_query->max_num_pages; $localize['pagination'] = $blog_pagination; $localize['infinite_scroll_event'] = $blog_infinite_scroll_event; $localize['no_more_post_message'] = apply_filters( 'astra_blog_no_more_post_text', __( 'No more posts to show.', 'astra-addon' ) ); $localize['grid_layout'] = $grid_layout; $localize['site_url'] = get_site_url(); $localize['show_comments'] = __( 'Show Comments', 'astra-addon' ); // If woocommerce page template. if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) { $localize['masonryEnabled'] = false; } else { $localize['masonryEnabled'] = $blog_masonry; $localize['blogMasonryBreakPoint'] = absint( apply_filters( 'astra_blog_masonry_break_point', astra_addon_get_tablet_breakpoint() ) ); } return $localize; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.0 | Introduced. |