Version Description
Visit the Github release page.
Download this release
Release Info
Developer | nikeo |
Plugin | Nimble Page Builder |
Version | 3.1.33 |
Comparing to | |
See all releases |
Code changes from version 3.1.32 to 3.1.33
- inc/admin/nb-options.php +7 -7
- inc/admin/nimble-admin.php +17 -14
- inc/czr-base-fmk/czr-base-fmk.php +35 -35
- inc/czr-skope/index.php +3 -3
- inc/functions.php +6 -1
- inc/sektions/ccat-constants-and-helper-functions.php +37 -15
- inc/sektions/ccat-czr-sektions.php +47 -46
- inc/sektions/ccat-sektions-base.php +49 -49
- inc/sektions/ccat-sektions-ui-modules.php +2 -2
- nimble-builder.php +163 -163
- readme.txt +134 -133
- tmpl/header/nimble_header_tmpl.php +1 -1
- tmpl/modules/divider_module_tmpl.php +1 -1
- tmpl/modules/featured_pages_module_tmpl.php +8 -8
- tmpl/modules/gallery_tmpl.php +4 -4
- tmpl/modules/heading_module_tmpl.php +2 -2
- tmpl/modules/image_module_tmpl.php +1 -1
- tmpl/modules/img_slider_tmpl.php +4 -4
- tmpl/modules/menu_module_tmpl.php +3 -3
- tmpl/modules/post_grid_module_tmpl.php +16 -16
- tmpl/modules/quote_module_tmpl.php +2 -2
- tmpl/modules/simple_form_module_tmpl.php +2 -2
- tmpl/modules/simple_html_module_tmpl.php +2 -2
- tmpl/modules/social_icons_tmpl.php +2 -2
- tmpl/modules/spacer_module_tmpl.php +1 -1
- tmpl/modules/special_img_module_tmpl.php +1 -1
- tmpl/modules/tinymce_editor_module_tmpl.php +2 -2
inc/admin/nb-options.php
CHANGED
@@ -63,7 +63,7 @@ function nb_options_page() {
|
|
63 |
if ( function_exists( $_cb ) ) {
|
64 |
call_user_func( $_cb );
|
65 |
} else {
|
66 |
-
echo $_cb;
|
67 |
}
|
68 |
} else if ( is_array($_cb) && 2 == count($_cb) ) {
|
69 |
if ( is_object($_cb[0]) ) {
|
@@ -164,7 +164,7 @@ function nb_register_option_tab( $tab ) {
|
|
164 |
|
165 |
function nb_get_active_option_tab() {
|
166 |
// check that we have a tab param and that this tab is registered
|
167 |
-
$tab_id = isset( $_GET['tab'] ) ? $_GET['tab'] : 'welcome';
|
168 |
if ( !array_key_exists( $tab_id, Nimble_Manager()->admin_option_tabs ) ) {
|
169 |
sek_error_log( __FUNCTION__ . ' error => invalid tab');
|
170 |
$tab_id = 'welcome';
|
@@ -184,7 +184,7 @@ nb_register_option_tab([
|
|
184 |
function print_welcome_page() {
|
185 |
?>
|
186 |
<div class="nimble-welcome-content">
|
187 |
-
<?php echo sek_get_welcome_block(); ?>
|
188 |
</div>
|
189 |
<div class="clear"></div>
|
190 |
<hr/>
|
@@ -335,7 +335,7 @@ nb_register_option_tab([
|
|
335 |
]);
|
336 |
function print_options_page() {
|
337 |
?>
|
338 |
-
<form method="post" action="<?php echo
|
339 |
<table class="form-table" role="presentation">
|
340 |
<tbody>
|
341 |
<tr>
|
@@ -404,7 +404,7 @@ function print_options_page() {
|
|
404 |
var nb_refresh_opt_page = function() {
|
405 |
jQuery( function($) {
|
406 |
_nonce_value = $('#nb-base-options-nonce').val();
|
407 |
-
_url = '<?php echo $refresh_url; ?>';
|
408 |
// add nonce as param so NB can verify it when the page reloads
|
409 |
if ( _nonce_value ) {
|
410 |
_url = _url + '&ecnon=' + _nonce_value;// looks like site.com/wp-admin/options-general.php?page=nb-options&tab=options&clean_nb=true&ecnon=7cc5758b65
|
@@ -414,7 +414,7 @@ function print_options_page() {
|
|
414 |
};
|
415 |
</script>
|
416 |
|
417 |
-
<?php if ( isset( $_GET['clean_nb'] ) && $_GET['clean_nb'] ) : ?>
|
418 |
<?php $status = sek_clean_all_nimble_data(); ?>
|
419 |
<?php if ( 'success' === $status ) : ?>
|
420 |
<div id="message" class="updated notice">
|
@@ -521,7 +521,7 @@ function print_system_info() {
|
|
521 |
?>
|
522 |
<h3><?php _e( 'System Informations', 'nimble-builder' ); ?></h3>
|
523 |
<h4><?php _e( 'Please include your system informations when posting support requests.' , 'nimble-builder' ) ?></h4>
|
524 |
-
<textarea readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="tc-sysinfo" title="<?php _e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'nimble-builder' ); ?>" style="width: 800px;min-height: 800px;font-family: Menlo,Monaco,monospace;background: 0 0;white-space: pre;overflow: auto;display:block;"><?php echo sek_config_infos(); ?></textarea>
|
525 |
<?php
|
526 |
}
|
527 |
|
63 |
if ( function_exists( $_cb ) ) {
|
64 |
call_user_func( $_cb );
|
65 |
} else {
|
66 |
+
echo esc_html($_cb);
|
67 |
}
|
68 |
} else if ( is_array($_cb) && 2 == count($_cb) ) {
|
69 |
if ( is_object($_cb[0]) ) {
|
164 |
|
165 |
function nb_get_active_option_tab() {
|
166 |
// check that we have a tab param and that this tab is registered
|
167 |
+
$tab_id = isset( $_GET['tab'] ) ? sanitize_text_field($_GET['tab']) : 'welcome';
|
168 |
if ( !array_key_exists( $tab_id, Nimble_Manager()->admin_option_tabs ) ) {
|
169 |
sek_error_log( __FUNCTION__ . ' error => invalid tab');
|
170 |
$tab_id = 'welcome';
|
184 |
function print_welcome_page() {
|
185 |
?>
|
186 |
<div class="nimble-welcome-content">
|
187 |
+
<?php echo esc_html(sek_get_welcome_block()); ?>
|
188 |
</div>
|
189 |
<div class="clear"></div>
|
190 |
<hr/>
|
335 |
]);
|
336 |
function print_options_page() {
|
337 |
?>
|
338 |
+
<form method="post" action="<?php echo admin_url( 'admin-post.php' ) ; ?>">
|
339 |
<table class="form-table" role="presentation">
|
340 |
<tbody>
|
341 |
<tr>
|
404 |
var nb_refresh_opt_page = function() {
|
405 |
jQuery( function($) {
|
406 |
_nonce_value = $('#nb-base-options-nonce').val();
|
407 |
+
_url = '<?php echo esc_url($refresh_url); ?>';
|
408 |
// add nonce as param so NB can verify it when the page reloads
|
409 |
if ( _nonce_value ) {
|
410 |
_url = _url + '&ecnon=' + _nonce_value;// looks like site.com/wp-admin/options-general.php?page=nb-options&tab=options&clean_nb=true&ecnon=7cc5758b65
|
414 |
};
|
415 |
</script>
|
416 |
|
417 |
+
<?php if ( isset( $_GET['clean_nb'] ) && sanitize_text_field($_GET['clean_nb']) ) : ?>
|
418 |
<?php $status = sek_clean_all_nimble_data(); ?>
|
419 |
<?php if ( 'success' === $status ) : ?>
|
420 |
<div id="message" class="updated notice">
|
521 |
?>
|
522 |
<h3><?php _e( 'System Informations', 'nimble-builder' ); ?></h3>
|
523 |
<h4><?php _e( 'Please include your system informations when posting support requests.' , 'nimble-builder' ) ?></h4>
|
524 |
+
<textarea readonly="readonly" onclick="this.focus();this.select()" id="system-info-textarea" name="tc-sysinfo" title="<?php _e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'nimble-builder' ); ?>" style="width: 800px;min-height: 800px;font-family: Menlo,Monaco,monospace;background: 0 0;white-space: pre;overflow: auto;display:block;"><?php echo esc_html(sek_config_infos()); ?></textarea>
|
525 |
<?php
|
526 |
}
|
527 |
|
inc/admin/nimble-admin.php
CHANGED
@@ -21,7 +21,7 @@ function sek_plugin_menu() {
|
|
21 |
}
|
22 |
add_action( 'admin_init' , '\Nimble\sek_redirect_system_info' );
|
23 |
function sek_redirect_system_info() {
|
24 |
-
if ( isset( $_GET['page'] ) && 'nimble-builder' === $_GET['page'] ) {
|
25 |
wp_safe_redirect( urldecode( admin_url( NIMBLE_OPTIONS_PAGE_URL . '&tab=system-info' ) ) );
|
26 |
exit;
|
27 |
}
|
@@ -183,7 +183,7 @@ function sek_print_nb_btn_edit_with_nimble( $editor_type ) {
|
|
183 |
}
|
184 |
$btn_css_classes = 'classic' === $editor_type ? 'button button-primary button-hero classic-ed' : 'button button-primary button-large guten-ed';
|
185 |
?>
|
186 |
-
<button id="sek-edit-with-nimble" type="button" class="<?php echo $btn_css_classes; ?>" data-cust-url="<?php echo esc_url( $customize_url ); ?>">
|
187 |
<?php //_e( 'Edit with Nimble Builder', 'text_doma' ); ?>
|
188 |
<?php printf( '<span class="sek-spinner"></span><span class="sek-nimble-icon" title="%3$s"><img src="%1$s" alt="%2$s"/><span class="sek-nimble-admin-bar-title">%2$s</span><span class="sek-nimble-mobile-admin-bar-title">%3$s</span></span>',
|
189 |
NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION,
|
@@ -272,7 +272,7 @@ function sek_ajax_get_nimble_content_for_seo_plugins() {
|
|
272 |
if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
273 |
wp_send_json_error( __FUNCTION__ . ' error => missing skope_id' );
|
274 |
}
|
275 |
-
$html = sek_get_raw_html_from_skope_id( $_POST['skope_id'] );
|
276 |
wp_send_json_success($html);
|
277 |
}
|
278 |
add_action( 'admin_footer', '\Nimble\sek_print_js_for_yoast_analysis' );
|
@@ -377,9 +377,9 @@ function sek_nimble_dashboard_callback_fn() {
|
|
377 |
<div class="nimble-db-wrapper">
|
378 |
<div class="nimble-db-header">
|
379 |
<div class="nimble-logo-version">
|
380 |
-
<div class="nimble-logo"><div class="sek-nimble-icon" title="<?php _e('Add sections in live preview with Nimble Builder', 'nimble-builder' );?>"><img src="<?php echo NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION; ?>" alt="Nimble Builder"></div></div>
|
381 |
<div class="nimble-version">
|
382 |
-
<span class="nimble-version-text"><?php _e('Nimble Builder', 'nimble-builder'); ?> v<?php echo NIMBLE_VERSION; ?></span>
|
383 |
<?php if ( sek_is_presscustomizr_theme( $theme_name ) ) : ?>
|
384 |
<?php
|
385 |
$theme_data = wp_get_theme();
|
@@ -393,15 +393,18 @@ function sek_nimble_dashboard_callback_fn() {
|
|
393 |
__('Go Pro', 'nimble-builder')
|
394 |
);
|
395 |
?>
|
|
|
|
|
|
|
396 |
<?php else : ?>
|
397 |
<?php printf( '<a href="%1$s" class="button button-primary button-hero"><span class="dashicons dashicons-admin-appearance"></span> %2$s</a>',
|
398 |
-
|
399 |
array(
|
400 |
array( 'autofocus' => array( 'section' => '__content_picker__' ) ),
|
401 |
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
|
402 |
),
|
403 |
admin_url( 'customize.php' )
|
404 |
-
)
|
405 |
__( 'Start building', 'nimble-builder' )
|
406 |
); ?>
|
407 |
<?php endif; ?>
|
@@ -446,7 +449,7 @@ function sek_nimble_dashboard_callback_fn() {
|
|
446 |
<?php foreach ( $footer_links as $link_id => $link_data ) : ?>
|
447 |
<div class="nimble-footer-link-<?php echo esc_attr( $link_id ); ?>">
|
448 |
<?php if ( !empty( $link_data['html'] ) ) : ?>
|
449 |
-
<?php echo $link_data['html']; ?>
|
450 |
<?php else : ?>
|
451 |
<a href="<?php echo esc_attr( $link_data['link'] ); ?>" target="_blank"><?php echo esc_html( $link_data['title'] ); ?> <span class="screen-reader-text"><?php echo __( '(opens in a new window)', 'nimble-builder' ); ?></span></a><span aria-hidden="true" class="dashicons dashicons-external"></span>
|
452 |
<?php endif; ?>
|
@@ -547,7 +550,7 @@ function sek_may_be_display_update_notice() {
|
|
547 |
</div>
|
548 |
<?php
|
549 |
$_html = ob_get_clean();
|
550 |
-
echo apply_filters( 'sek_update_notice', $_html );
|
551 |
?>
|
552 |
<script type="text/javascript" id="nimble-dismiss-update-notice">
|
553 |
( function($){
|
@@ -706,7 +709,7 @@ function sek_maybe_display_feedback_notice() {
|
|
706 |
<div class="notice notice-success is-dismissible" id="<?php echo esc_attr( $notice_id ); ?>">
|
707 |
<h3><span class="nb-wp-menu-notif"><span class="update-count">1</span></span> <?php _e('Hi👋 ! A quick note on Nimble Builder Pro', 'nimble-builder'); ?> </h3>
|
708 |
<div class="nimble-logo-feedback-notice">
|
709 |
-
<div class="nimble-logo"><div class="sek-nimble-icon"><img src="<?php echo NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION; ?>" alt="Nimble Builder"></div></div>
|
710 |
<div class="nimble-feedback">
|
711 |
|
712 |
<p><?php
|
@@ -727,7 +730,7 @@ function sek_maybe_display_feedback_notice() {
|
|
727 |
</div>
|
728 |
<?php
|
729 |
$_html = ob_get_clean();
|
730 |
-
echo apply_filters( 'sek_feedback_notice', $_html );
|
731 |
?>
|
732 |
<?php
|
733 |
}
|
@@ -749,7 +752,7 @@ function sek_render_welcome_notice() {
|
|
749 |
return;
|
750 |
if ( sek_welcome_notice_is_dismissed() )
|
751 |
return;
|
752 |
-
if ( isset($_GET['page']) && NIMBLE_OPTIONS_PAGE === $_GET['page'] )
|
753 |
return;
|
754 |
$current_screen = get_current_screen();
|
755 |
if( in_array( $current_screen->base, array(
|
@@ -808,13 +811,13 @@ function sek_get_welcome_block() {
|
|
808 |
<p><?php _e( 'Nimble allows you to drag and drop content modules, or pre-built section templates, into <u>any context</u> of your site, including search results or 404 pages. You can edit your pages in <i>real time</i> from the live customizer, and then publish when you are happy of the result, or save for later.', 'nimble-builder' ); ?></p>
|
809 |
<p><?php _e( 'The plugin automatically creates fluid and responsive sections for a pixel-perfect rendering on smartphones and tablets, without the need to add complex code.', 'nimble-builder' ); ?></p>
|
810 |
<?php printf( '<a href="%1$s" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-admin-appearance"></span> %2$s</a>',
|
811 |
-
|
812 |
array(
|
813 |
array( 'autofocus' => array( 'section' => '__content_picker__' ) ),
|
814 |
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
|
815 |
),
|
816 |
admin_url( 'customize.php' )
|
817 |
-
)
|
818 |
__( 'Start creating content in live preview', 'nimble-builder' )
|
819 |
); ?>
|
820 |
<div class="nimble-link-to-doc">
|
21 |
}
|
22 |
add_action( 'admin_init' , '\Nimble\sek_redirect_system_info' );
|
23 |
function sek_redirect_system_info() {
|
24 |
+
if ( isset( $_GET['page'] ) && 'nimble-builder' === sanitize_text_field($_GET['page']) ) {
|
25 |
wp_safe_redirect( urldecode( admin_url( NIMBLE_OPTIONS_PAGE_URL . '&tab=system-info' ) ) );
|
26 |
exit;
|
27 |
}
|
183 |
}
|
184 |
$btn_css_classes = 'classic' === $editor_type ? 'button button-primary button-hero classic-ed' : 'button button-primary button-large guten-ed';
|
185 |
?>
|
186 |
+
<button id="sek-edit-with-nimble" type="button" class="<?php echo esc_html($btn_css_classes); ?>" data-cust-url="<?php echo esc_url( $customize_url ); ?>">
|
187 |
<?php //_e( 'Edit with Nimble Builder', 'text_doma' ); ?>
|
188 |
<?php printf( '<span class="sek-spinner"></span><span class="sek-nimble-icon" title="%3$s"><img src="%1$s" alt="%2$s"/><span class="sek-nimble-admin-bar-title">%2$s</span><span class="sek-nimble-mobile-admin-bar-title">%3$s</span></span>',
|
189 |
NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION,
|
272 |
if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
273 |
wp_send_json_error( __FUNCTION__ . ' error => missing skope_id' );
|
274 |
}
|
275 |
+
$html = sek_get_raw_html_from_skope_id( sanitize_text_field($_POST['skope_id']) );
|
276 |
wp_send_json_success($html);
|
277 |
}
|
278 |
add_action( 'admin_footer', '\Nimble\sek_print_js_for_yoast_analysis' );
|
377 |
<div class="nimble-db-wrapper">
|
378 |
<div class="nimble-db-header">
|
379 |
<div class="nimble-logo-version">
|
380 |
+
<div class="nimble-logo"><div class="sek-nimble-icon" title="<?php _e('Add sections in live preview with Nimble Builder', 'nimble-builder' );?>"><img src="<?php echo esc_url(NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION); ?>" alt="Nimble Builder"></div></div>
|
381 |
<div class="nimble-version">
|
382 |
+
<span class="nimble-version-text"><?php _e('Nimble Builder', 'nimble-builder'); ?> v<?php echo esc_attr(NIMBLE_VERSION); ?></span>
|
383 |
<?php if ( sek_is_presscustomizr_theme( $theme_name ) ) : ?>
|
384 |
<?php
|
385 |
$theme_data = wp_get_theme();
|
393 |
__('Go Pro', 'nimble-builder')
|
394 |
);
|
395 |
?>
|
396 |
+
<?php
|
397 |
+
// NeedClarification
|
398 |
+
?>
|
399 |
<?php else : ?>
|
400 |
<?php printf( '<a href="%1$s" class="button button-primary button-hero"><span class="dashicons dashicons-admin-appearance"></span> %2$s</a>',
|
401 |
+
add_query_arg(
|
402 |
array(
|
403 |
array( 'autofocus' => array( 'section' => '__content_picker__' ) ),
|
404 |
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
|
405 |
),
|
406 |
admin_url( 'customize.php' )
|
407 |
+
),
|
408 |
__( 'Start building', 'nimble-builder' )
|
409 |
); ?>
|
410 |
<?php endif; ?>
|
449 |
<?php foreach ( $footer_links as $link_id => $link_data ) : ?>
|
450 |
<div class="nimble-footer-link-<?php echo esc_attr( $link_id ); ?>">
|
451 |
<?php if ( !empty( $link_data['html'] ) ) : ?>
|
452 |
+
<?php echo esc_html($link_data['html']); ?>
|
453 |
<?php else : ?>
|
454 |
<a href="<?php echo esc_attr( $link_data['link'] ); ?>" target="_blank"><?php echo esc_html( $link_data['title'] ); ?> <span class="screen-reader-text"><?php echo __( '(opens in a new window)', 'nimble-builder' ); ?></span></a><span aria-hidden="true" class="dashicons dashicons-external"></span>
|
455 |
<?php endif; ?>
|
550 |
</div>
|
551 |
<?php
|
552 |
$_html = ob_get_clean();
|
553 |
+
echo apply_filters( 'sek_update_notice', esc_html($_html) );
|
554 |
?>
|
555 |
<script type="text/javascript" id="nimble-dismiss-update-notice">
|
556 |
( function($){
|
709 |
<div class="notice notice-success is-dismissible" id="<?php echo esc_attr( $notice_id ); ?>">
|
710 |
<h3><span class="nb-wp-menu-notif"><span class="update-count">1</span></span> <?php _e('Hi👋 ! A quick note on Nimble Builder Pro', 'nimble-builder'); ?> </h3>
|
711 |
<div class="nimble-logo-feedback-notice">
|
712 |
+
<div class="nimble-logo"><div class="sek-nimble-icon"><img src="<?php echo esc_url(NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION); ?>" alt="Nimble Builder"></div></div>
|
713 |
<div class="nimble-feedback">
|
714 |
|
715 |
<p><?php
|
730 |
</div>
|
731 |
<?php
|
732 |
$_html = ob_get_clean();
|
733 |
+
echo apply_filters( 'sek_feedback_notice', esc_html($_html) );
|
734 |
?>
|
735 |
<?php
|
736 |
}
|
752 |
return;
|
753 |
if ( sek_welcome_notice_is_dismissed() )
|
754 |
return;
|
755 |
+
if ( isset($_GET['page']) && NIMBLE_OPTIONS_PAGE === sanitize_text_field($_GET['page']) )
|
756 |
return;
|
757 |
$current_screen = get_current_screen();
|
758 |
if( in_array( $current_screen->base, array(
|
811 |
<p><?php _e( 'Nimble allows you to drag and drop content modules, or pre-built section templates, into <u>any context</u> of your site, including search results or 404 pages. You can edit your pages in <i>real time</i> from the live customizer, and then publish when you are happy of the result, or save for later.', 'nimble-builder' ); ?></p>
|
812 |
<p><?php _e( 'The plugin automatically creates fluid and responsive sections for a pixel-perfect rendering on smartphones and tablets, without the need to add complex code.', 'nimble-builder' ); ?></p>
|
813 |
<?php printf( '<a href="%1$s" target="_blank" class="button button-primary button-hero"><span class="dashicons dashicons-admin-appearance"></span> %2$s</a>',
|
814 |
+
add_query_arg(
|
815 |
array(
|
816 |
array( 'autofocus' => array( 'section' => '__content_picker__' ) ),
|
817 |
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
|
818 |
),
|
819 |
admin_url( 'customize.php' )
|
820 |
+
),
|
821 |
__( 'Start creating content in live preview', 'nimble-builder' )
|
822 |
); ?>
|
823 |
<div class="nimble-link-to-doc">
|
inc/czr-base-fmk/czr-base-fmk.php
CHANGED
@@ -484,8 +484,8 @@ if ( !class_exists( 'CZR_Fmk_Base_Ajax_Filter' ) ) :
|
|
484 |
if ( !isset( $_POST['tmpl'] ) || empty( $_POST['tmpl'] ) ) {
|
485 |
wp_send_json_error( 'ac_set_ajax_czr_tmpl => missing tmpl property in posted data' );
|
486 |
}
|
487 |
-
$tmpl = $_POST['tmpl'];
|
488 |
-
$module_type = $_POST['module_type'];
|
489 |
|
490 |
///////////////////////////////////////////////////////////////////////
|
491 |
// @param $tmpl = 'item-inputs'
|
@@ -546,26 +546,26 @@ if ( !class_exists( 'CZR_Fmk_Base_Ajax_Filter' ) ) :
|
|
546 |
switch ( $requested_tmpl ) {
|
547 |
case 'crud-module-part' :
|
548 |
?>
|
549 |
-
<button class="<?php echo $css_attr['open_pre_add_btn']; ?>"><?php _e('Add New', 'nimble-builder'); ?> <span class="fas fa-plus-square"></span></button>
|
550 |
-
<div class="<?php echo $css_attr['pre_add_wrapper']; ?>">
|
551 |
-
<div class="<?php echo $css_attr['pre_add_success']; ?>"><p></p></div>
|
552 |
-
<div class="<?php echo $css_attr['pre_add_item_content']; ?>">
|
553 |
|
554 |
-
<span class="<?php echo $css_attr['cancel_pre_add_btn']; ?> button"><?php _e('Cancel', 'nimble-builder'); ?></span> <span class="<?php echo $css_attr['add_new_btn']; ?> button"><?php _e('Add it', 'nimble-builder'); ?></span>
|
555 |
</div>
|
556 |
</div>
|
557 |
<?php
|
558 |
break;
|
559 |
case 'rud-item-part' :
|
560 |
?>
|
561 |
-
<div class="<?php echo $css_attr['item_header']; ?> czr-custom-model">
|
562 |
<# if ( ( true === data.is_sortable ) ) { #>
|
563 |
-
<div class="<?php echo $css_attr['item_title']; ?> <?php echo $css_attr['item_sort_handle']; ?>"><h4>{{ data.title }}</h4></div>
|
564 |
<# } else { #>
|
565 |
-
<div class="<?php echo $css_attr['item_title']; ?>"><h4>{{ data.title }}</h4></div>
|
566 |
<# } #>
|
567 |
-
<div class="<?php echo $css_attr['item_btns']; ?>"><a title="<?php _e('Edit', 'nimble-builder'); ?>" href="javascript:void(0);" class="fas fa-pencil-alt <?php echo $css_attr['edit_view_btn']; ?>"></a> <a title="<?php _e('Remove', 'nimble-builder'); ?>" href="javascript:void(0);" class="fas fa-trash <?php echo $css_attr['display_alert_btn']; ?>"></a></div>
|
568 |
-
<div class="<?php echo $css_attr['remove_alert_wrapper']; ?>"></div>
|
569 |
</div>
|
570 |
<?php
|
571 |
break;
|
@@ -573,7 +573,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Ajax_Filter' ) ) :
|
|
573 |
case 'rud-item-alert-part' :
|
574 |
?>
|
575 |
<p class="czr-item-removal-title"><?php _e('Are you sure you want to remove : <strong>{{ data.title }} ?</strong>', 'nimble-builder'); ?></p>
|
576 |
-
<span class="<?php echo $css_attr['remove_view_btn']; ?> button"><?php _e('Yes', 'nimble-builder'); ?></span> <span class="<?php echo $css_attr['cancel_alert_btn']; ?> button"><?php _e('No', 'nimble-builder'); ?></span>
|
577 |
<?php
|
578 |
break;
|
579 |
|
@@ -768,11 +768,11 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
768 |
);
|
769 |
?>
|
770 |
<?php if ( !empty( $input_data['html_before'] ) ) : ?>
|
771 |
-
<div class="czr-html-before"><?php echo $input_data['html_before']; ?></div>
|
772 |
<?php endif; ?>
|
773 |
|
774 |
<?php if ( !empty( $input_data['notice_before_title'] ) ) : ?>
|
775 |
-
<span class="czr-notice"><?php echo $input_data['notice_before_title']; ?></span><br/>
|
776 |
<?php endif; ?>
|
777 |
|
778 |
<?php
|
@@ -782,14 +782,14 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
782 |
}
|
783 |
?>
|
784 |
<?php if ( !empty( $input_data['notice_before'] ) ) : ?>
|
785 |
-
<span class="czr-notice"><?php echo $input_data['notice_before']; ?></span>
|
786 |
<?php endif; ?>
|
787 |
|
788 |
<?php printf( '<div class="czr-input %1$s">', !empty( $input_data['input_width'] ) ? $input_data['input_width'] : '' ); ?>
|
789 |
|
790 |
<?php
|
791 |
if ( !empty( $input_data['input_template'] ) && is_string( $input_data['input_template'] ) ) {
|
792 |
-
echo $input_data['input_template'];
|
793 |
} else {
|
794 |
// THIS IS WHERE THE ACTUAL INPUT CONTENT IS SET
|
795 |
$this -> ac_set_input_tmpl_content( $input_type, $input_id, $input_data );
|
@@ -797,11 +797,11 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
797 |
?>
|
798 |
</div><?php // class="czr-input" ?>
|
799 |
<?php if ( !empty( $input_data['notice_after'] ) ) : ?>
|
800 |
-
<span class="czr-notice"><?php echo $input_data['notice_after']; ?></span>
|
801 |
<?php endif; ?>
|
802 |
|
803 |
<?php if ( !empty( $input_data['html_after'] ) ) : ?>
|
804 |
-
<div class="czr-html-after"><?php echo $input_data['html_after']; ?></div>
|
805 |
<?php endif; ?>
|
806 |
|
807 |
</div> <?php //class="$css_attr['sub_set_wrapper']" ?>
|
@@ -834,7 +834,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
834 |
$input_tmpl_content = ob_get_clean();
|
835 |
|
836 |
if ( !empty( $input_tmpl_content ) ) {
|
837 |
-
echo $input_tmpl_content;
|
838 |
} else {
|
839 |
// Then, if we have no content yet, let's go thought the default input cases
|
840 |
switch ( $input_type ) {
|
@@ -843,7 +843,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
843 |
/* ------------------------------------------------------------------------- */
|
844 |
case 'hidden':
|
845 |
?>
|
846 |
-
<input data-czrtype="<?php echo $input_id; ?>" type="hidden" value=""></input>
|
847 |
<?php
|
848 |
break;
|
849 |
|
@@ -854,14 +854,14 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
854 |
case 'select'://<= used in the customizr and hueman theme
|
855 |
case 'simpleselect'://<=used in Nimble Builder
|
856 |
?>
|
857 |
-
<select data-czrtype="<?php echo $input_id; ?>"></select>
|
858 |
<?php
|
859 |
break;
|
860 |
// multiselect with select2() js library
|
861 |
case 'multiselect':
|
862 |
case 'category_picker':
|
863 |
?>
|
864 |
-
<select multiple="multiple" data-czrtype="<?php echo $input_id; ?>"></select>
|
865 |
<?php
|
866 |
break;
|
867 |
|
@@ -870,7 +870,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
870 |
/* ------------------------------------------------------------------------- */
|
871 |
case 'text' :
|
872 |
?>
|
873 |
-
<input data-czrtype="<?php echo $input_id; ?>" type="text" value="" placeholder="<?php echo $input_data['placeholder']; ?>"></input>
|
874 |
<?php
|
875 |
break;
|
876 |
|
@@ -895,12 +895,12 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
895 |
/* ------------------------------------------------------------------------- */
|
896 |
case 'wp_color_alpha' :
|
897 |
?>
|
898 |
-
<input data-czrtype="<?php echo $input_id; ?>" class="width-100" data-alpha="true" type="text" value="{{ data['<?php echo $input_id; ?>'] }}"></input>
|
899 |
<?php
|
900 |
break;
|
901 |
case 'color' :
|
902 |
?>
|
903 |
-
<input data-czrtype="<?php echo $input_id; ?>" type="text" value="{{ data['<?php echo $input_id; ?>'] }}"></input>
|
904 |
<?php
|
905 |
break;
|
906 |
|
@@ -911,7 +911,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
911 |
case 'check' :
|
912 |
?>
|
913 |
<#
|
914 |
-
var _checked = ( false != data['<?php echo $input_id; ?>'] ) ? "checked=checked" : '';
|
915 |
#>
|
916 |
<input data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }}></input>
|
917 |
<?php
|
@@ -921,16 +921,16 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
921 |
case 'gutencheck' :
|
922 |
?>
|
923 |
<#
|
924 |
-
var _checked = ( false != data['<?php echo $input_id; ?>'] ) ? "checked=checked" : '';
|
925 |
#>
|
926 |
-
<span class="czr-toggle-check"><input class="czr-toggle-check__input" data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }}><span class="czr-toggle-check__track"></span><span class="czr-toggle-check__thumb"></span></span>
|
927 |
<?php
|
928 |
break;
|
929 |
|
930 |
case 'nimblecheck' :
|
931 |
?>
|
932 |
<#
|
933 |
-
var _checked = ( false != data['<?php echo $input_id; ?>'] ) ? "checked=checked" : '';
|
934 |
#>
|
935 |
<?php
|
936 |
// when input and label are tied by an id - for relationship
|
@@ -941,8 +941,8 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
941 |
$unique_id = sprintf('%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535));
|
942 |
?>
|
943 |
<div class="nimblecheck-wrap">
|
944 |
-
<input id="nimblecheck-<?php echo $unique_id; ?>" data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }} class="nimblecheck-input">
|
945 |
-
<label for="nimblecheck-<?php echo $unique_id; ?>" class="nimblecheck-label">Switch</label>
|
946 |
</div>
|
947 |
<?php
|
948 |
break;
|
@@ -954,7 +954,7 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
954 |
// Added an id attribute for https://github.com/presscustomizr/nimble-builder/issues/403
|
955 |
// needed to instantiate wp.editor.initialize(...)
|
956 |
?>
|
957 |
-
<textarea id="textarea-{{ data.id }}" data-czrtype="<?php echo $input_id; ?>" class="width-100" name="textarea" rows="10" cols="">{{ data.value }}</textarea>
|
958 |
<?php
|
959 |
break;
|
960 |
|
@@ -964,8 +964,8 @@ if ( !class_exists( 'CZR_Fmk_Base_Tmpl_Builder' ) ) :
|
|
964 |
case 'upload' :
|
965 |
case 'upload_url' :
|
966 |
?>
|
967 |
-
<input data-czrtype="<?php echo $input_id; ?>" type="hidden"/>
|
968 |
-
<div class="<?php echo $css_attr['img_upload_container']; ?>"></div>
|
969 |
<?php
|
970 |
break;
|
971 |
|
484 |
if ( !isset( $_POST['tmpl'] ) || empty( $_POST['tmpl'] ) ) {
|
485 |
wp_send_json_error( 'ac_set_ajax_czr_tmpl => missing tmpl property in posted data' );
|
486 |
}
|
487 |
+
$tmpl = sanitize_text_field($_POST['tmpl']);
|
488 |
+
$module_type = sanitize_text_field($_POST['module_type']);
|
489 |
|
490 |
///////////////////////////////////////////////////////////////////////
|
491 |
// @param $tmpl = 'item-inputs'
|
546 |
switch ( $requested_tmpl ) {
|
547 |
case 'crud-module-part' :
|
548 |
?>
|
549 |
+
<button class="<?php echo esc_attr($css_attr['open_pre_add_btn']); ?>"><?php _e('Add New', 'nimble-builder'); ?> <span class="fas fa-plus-square"></span></button>
|
550 |
+
<div class="<?php echo esc_attr($css_attr['pre_add_wrapper']); ?>">
|
551 |
+
<div class="<?php echo esc_attr($css_attr['pre_add_success']); ?>"><p></p></div>
|
552 |
+
<div class="<?php echo esc_attr($css_attr['pre_add_item_content']); ?>">
|
553 |
|
554 |
+
<span class="<?php echo esc_attr($css_attr['cancel_pre_add_btn']); ?> button"><?php _e('Cancel', 'nimble-builder'); ?></span> <span class="<?php echo esc_attr($css_attr['add_new_btn']); ?> button"><?php _e('Add it', 'nimble-builder'); ?></span>
|
555 |
</div>
|
556 |
</div>
|
557 |
<?php
|
558 |
break;
|
559 |
case 'rud-item-part' :
|
560 |
?>
|
561 |
+
<div class="<?php echo esc_attr($css_attr['item_header']); ?> czr-custom-model">
|
562 |
<# if ( ( true === data.is_sortable ) ) { #>
|
563 |
+
<div class="<?php echo esc_attr($css_attr['item_title']); ?> <?php echo esc_attr($css_attr['item_sort_handle']); ?>"><h4>{{ data.title }}</h4></div>
|
564 |
<# } else { #>
|
565 |
+
<div class="<?php echo esc_attr($css_attr['item_title']); ?>"><h4>{{ data.title }}</h4></div>
|
566 |
<# } #>
|
567 |
+
<div class="<?php echo esc_attr($css_attr['item_btns']); ?>"><a title="<?php _e('Edit', 'nimble-builder'); ?>" href="javascript:void(0);" class="fas fa-pencil-alt <?php echo esc_attr($css_attr['edit_view_btn']); ?>"></a> <a title="<?php _e('Remove', 'nimble-builder'); ?>" href="javascript:void(0);" class="fas fa-trash <?php echo esc_attr($css_attr['display_alert_btn']); ?>"></a></div>
|
568 |
+
<div class="<?php echo esc_attr($css_attr['remove_alert_wrapper']); ?>"></div>
|
569 |
</div>
|
570 |
<?php
|
571 |
break;
|
573 |
case 'rud-item-alert-part' :
|
574 |
?>
|
575 |
<p class="czr-item-removal-title"><?php _e('Are you sure you want to remove : <strong>{{ data.title }} ?</strong>', 'nimble-builder'); ?></p>
|
576 |
+
<span class="<?php echo esc_attr($css_attr['remove_view_btn']); ?> button"><?php _e('Yes', 'nimble-builder'); ?></span> <span class="<?php echo esc_attr($css_attr['cancel_alert_btn']); ?> button"><?php _e('No', 'nimble-builder'); ?></span>
|
577 |
<?php
|
578 |
break;
|
579 |
|
768 |
);
|
769 |
?>
|
770 |
<?php if ( !empty( $input_data['html_before'] ) ) : ?>
|
771 |
+
<div class="czr-html-before"><?php echo esc_html($input_data['html_before']); ?></div>
|
772 |
<?php endif; ?>
|
773 |
|
774 |
<?php if ( !empty( $input_data['notice_before_title'] ) ) : ?>
|
775 |
+
<span class="czr-notice"><?php echo esc_html($input_data['notice_before_title']); ?></span><br/>
|
776 |
<?php endif; ?>
|
777 |
|
778 |
<?php
|
782 |
}
|
783 |
?>
|
784 |
<?php if ( !empty( $input_data['notice_before'] ) ) : ?>
|
785 |
+
<span class="czr-notice"><?php echo esc_html($input_data['notice_before']); ?></span>
|
786 |
<?php endif; ?>
|
787 |
|
788 |
<?php printf( '<div class="czr-input %1$s">', !empty( $input_data['input_width'] ) ? $input_data['input_width'] : '' ); ?>
|
789 |
|
790 |
<?php
|
791 |
if ( !empty( $input_data['input_template'] ) && is_string( $input_data['input_template'] ) ) {
|
792 |
+
echo esc_html($input_data['input_template']);
|
793 |
} else {
|
794 |
// THIS IS WHERE THE ACTUAL INPUT CONTENT IS SET
|
795 |
$this -> ac_set_input_tmpl_content( $input_type, $input_id, $input_data );
|
797 |
?>
|
798 |
</div><?php // class="czr-input" ?>
|
799 |
<?php if ( !empty( $input_data['notice_after'] ) ) : ?>
|
800 |
+
<span class="czr-notice"><?php echo esc_html($input_data['notice_after']); ?></span>
|
801 |
<?php endif; ?>
|
802 |
|
803 |
<?php if ( !empty( $input_data['html_after'] ) ) : ?>
|
804 |
+
<div class="czr-html-after"><?php echo esc_html($input_data['html_after']); ?></div>
|
805 |
<?php endif; ?>
|
806 |
|
807 |
</div> <?php //class="$css_attr['sub_set_wrapper']" ?>
|
834 |
$input_tmpl_content = ob_get_clean();
|
835 |
|
836 |
if ( !empty( $input_tmpl_content ) ) {
|
837 |
+
echo esc_html($input_tmpl_content);
|
838 |
} else {
|
839 |
// Then, if we have no content yet, let's go thought the default input cases
|
840 |
switch ( $input_type ) {
|
843 |
/* ------------------------------------------------------------------------- */
|
844 |
case 'hidden':
|
845 |
?>
|
846 |
+
<input data-czrtype="<?php echo esc_attr($input_id); ?>" type="hidden" value=""></input>
|
847 |
<?php
|
848 |
break;
|
849 |
|
854 |
case 'select'://<= used in the customizr and hueman theme
|
855 |
case 'simpleselect'://<=used in Nimble Builder
|
856 |
?>
|
857 |
+
<select data-czrtype="<?php echo esc_attr($input_id); ?>"></select>
|
858 |
<?php
|
859 |
break;
|
860 |
// multiselect with select2() js library
|
861 |
case 'multiselect':
|
862 |
case 'category_picker':
|
863 |
?>
|
864 |
+
<select multiple="multiple" data-czrtype="<?php echo esc_attr($input_id); ?>"></select>
|
865 |
<?php
|
866 |
break;
|
867 |
|
870 |
/* ------------------------------------------------------------------------- */
|
871 |
case 'text' :
|
872 |
?>
|
873 |
+
<input data-czrtype="<?php echo esc_attr($input_id); ?>" type="text" value="" placeholder="<?php echo esc_attr($input_data['placeholder']); ?>"></input>
|
874 |
<?php
|
875 |
break;
|
876 |
|
895 |
/* ------------------------------------------------------------------------- */
|
896 |
case 'wp_color_alpha' :
|
897 |
?>
|
898 |
+
<input data-czrtype="<?php echo esc_attr($input_id); ?>" class="width-100" data-alpha="true" type="text" value="{{ data['<?php echo esc_attr($input_id); ?>'] }}"></input>
|
899 |
<?php
|
900 |
break;
|
901 |
case 'color' :
|
902 |
?>
|
903 |
+
<input data-czrtype="<?php echo esc_attr($input_id); ?>" type="text" value="{{ data['<?php echo esc_attr($input_id); ?>'] }}"></input>
|
904 |
<?php
|
905 |
break;
|
906 |
|
911 |
case 'check' :
|
912 |
?>
|
913 |
<#
|
914 |
+
var _checked = ( false != data['<?php echo esc_attr($input_id); ?>'] ) ? "checked=checked" : '';
|
915 |
#>
|
916 |
<input data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }}></input>
|
917 |
<?php
|
921 |
case 'gutencheck' :
|
922 |
?>
|
923 |
<#
|
924 |
+
var _checked = ( false != data['<?php echo esc_attr($input_id); ?>'] ) ? "checked=checked" : '';
|
925 |
#>
|
926 |
+
<span class="czr-toggle-check"><input class="czr-toggle-check__input" data-czrtype="<?php echo esc_attr($input_id); ?>" type="checkbox" {{ _checked }}><span class="czr-toggle-check__track"></span><span class="czr-toggle-check__thumb"></span></span>
|
927 |
<?php
|
928 |
break;
|
929 |
|
930 |
case 'nimblecheck' :
|
931 |
?>
|
932 |
<#
|
933 |
+
var _checked = ( false != data['<?php echo esc_attr($input_id); ?>'] ) ? "checked=checked" : '';
|
934 |
#>
|
935 |
<?php
|
936 |
// when input and label are tied by an id - for relationship
|
941 |
$unique_id = sprintf('%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535));
|
942 |
?>
|
943 |
<div class="nimblecheck-wrap">
|
944 |
+
<input id="nimblecheck-<?php echo esc_attr($unique_id); ?>" data-czrtype="<?php echo esc_attr($input_id); ?>" type="checkbox" {{ _checked }} class="nimblecheck-input">
|
945 |
+
<label for="nimblecheck-<?php echo esc_attr($unique_id); ?>" class="nimblecheck-label">Switch</label>
|
946 |
</div>
|
947 |
<?php
|
948 |
break;
|
954 |
// Added an id attribute for https://github.com/presscustomizr/nimble-builder/issues/403
|
955 |
// needed to instantiate wp.editor.initialize(...)
|
956 |
?>
|
957 |
+
<textarea id="textarea-{{ data.id }}" data-czrtype="<?php echo esc_attr($input_id); ?>" class="width-100" name="textarea" rows="10" cols="">{{ data.value }}</textarea>
|
958 |
<?php
|
959 |
break;
|
960 |
|
964 |
case 'upload' :
|
965 |
case 'upload_url' :
|
966 |
?>
|
967 |
+
<input data-czrtype="<?php echo esc_attr($input_id); ?>" type="hidden"/>
|
968 |
+
<div class="<?php echo esc_attr($css_attr['img_upload_container']); ?>"></div>
|
969 |
<?php
|
970 |
break;
|
971 |
|
inc/czr-skope/index.php
CHANGED
@@ -330,11 +330,11 @@ function skp_get_skope_id( $level = 'local' ) {
|
|
330 |
// => which will lead to skope_id set to '_skope_not_set_'
|
331 |
// in order to prevent this, let's get the skope_id value from the customizer posted value when available.
|
332 |
if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'local' === $level && !empty($_POST['local_skope_id']) ) {
|
333 |
-
$skope_id_to_return = $_POST['local_skope_id'];
|
334 |
}
|
335 |
// Feb 2021 => added for https://github.com/presscustomizr/nimble-builder/issues/478
|
336 |
if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'group' === $level && !empty($_POST['group_skope_id']) ) {
|
337 |
-
$skope_id_to_return = $_POST['group_skope_id'];
|
338 |
}
|
339 |
|
340 |
$skope_id_to_return = apply_filters( 'skp_get_skope_id', $skope_id_to_return, $level );
|
@@ -410,7 +410,7 @@ function skp_get_skope_title( $args = array() ) {
|
|
410 |
$long = $args['long'];
|
411 |
$is_prefixed = $args['is_prefixed'];
|
412 |
|
413 |
-
$_dyn_type = ( skp_is_customize_preview_frame() && isset( $_POST['dyn_type']) ) ? $_POST['dyn_type'] : '';
|
414 |
$type = skp_get_skope('type');
|
415 |
$skope = skp_get_skope();
|
416 |
$title = '';
|
330 |
// => which will lead to skope_id set to '_skope_not_set_'
|
331 |
// in order to prevent this, let's get the skope_id value from the customizer posted value when available.
|
332 |
if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'local' === $level && !empty($_POST['local_skope_id']) ) {
|
333 |
+
$skope_id_to_return = sanitize_text_field( wp_unslash($_POST['local_skope_id']));
|
334 |
}
|
335 |
// Feb 2021 => added for https://github.com/presscustomizr/nimble-builder/issues/478
|
336 |
if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'group' === $level && !empty($_POST['group_skope_id']) ) {
|
337 |
+
$skope_id_to_return = sanitize_text_field( wp_unslash($_POST['group_skope_id']));
|
338 |
}
|
339 |
|
340 |
$skope_id_to_return = apply_filters( 'skp_get_skope_id', $skope_id_to_return, $level );
|
410 |
$long = $args['long'];
|
411 |
$is_prefixed = $args['is_prefixed'];
|
412 |
|
413 |
+
$_dyn_type = ( skp_is_customize_preview_frame() && isset( $_POST['dyn_type']) ) ? sanitize_text_field( wp_unslash($_POST['dyn_type'])) : '';
|
414 |
$type = skp_get_skope('type');
|
415 |
$skope = skp_get_skope();
|
416 |
$title = '';
|
inc/functions.php
CHANGED
@@ -27,4 +27,9 @@ function nimble_get_content_as_json() {
|
|
27 |
'global_sections' => $global_sections
|
28 |
]);
|
29 |
return wp_json_encode( $raw_content );
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
27 |
'global_sections' => $global_sections
|
28 |
]);
|
29 |
return wp_json_encode( $raw_content );
|
30 |
+
}
|
31 |
+
|
32 |
+
remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
|
33 |
+
add_action( 'shutdown', function() {
|
34 |
+
while ( @ob_end_flush() );
|
35 |
+
} );
|
inc/sektions/ccat-constants-and-helper-functions.php
CHANGED
@@ -314,9 +314,9 @@ function sek_emit_js_event( $event = '', $echo = true ) {
|
|
314 |
Nimble_Manager()->emitted_js_event = $emitted;
|
315 |
$html = sprintf('<script>(function(){if(window.nb_){nb_.emit("%1$s");}})();</script>', $event );
|
316 |
if ( $echo ) {
|
317 |
-
echo $html;
|
318 |
} else {
|
319 |
-
return $html;
|
320 |
}
|
321 |
}
|
322 |
|
@@ -803,9 +803,9 @@ function sek_page_menu_fallback( $args = array() ) {
|
|
803 |
|
804 |
//$menu = apply_filters( 'wp_page_menu', $menu, $args );
|
805 |
if ( $args['echo'] )
|
806 |
-
echo $menu;
|
807 |
else
|
808 |
-
return $menu;
|
809 |
}
|
810 |
/**
|
811 |
* Retrieve or display list of pages in list (li) format.
|
@@ -858,9 +858,9 @@ function sek_list_pages( $args = '' ) {
|
|
858 |
}
|
859 |
$html = apply_filters( 'wp_list_pages', $output, $r );
|
860 |
if ( $r['echo'] ) {
|
861 |
-
echo $html;
|
862 |
} else {
|
863 |
-
return $html;
|
864 |
}
|
865 |
}
|
866 |
|
@@ -1746,7 +1746,7 @@ function sek_get_closest_section_custom_breakpoint( $params ) {
|
|
1746 |
if ( 'not_set' === $collection ) {
|
1747 |
if ( empty( $skope_id ) ) {
|
1748 |
if ( is_array( $_POST ) && !empty( $_POST['location_skope_id'] ) ) {
|
1749 |
-
$skope_id = $_POST['location_skope_id'];
|
1750 |
} else {
|
1751 |
// When fired during an ajax 'customize_save' action, the skp_get_skope_id() is determined with $_POST['local_skope_id']
|
1752 |
// @see add_filter( 'skp_get_skope_id', '\Nimble\sek_filter_skp_get_skope_id', 10, 2 );
|
@@ -2643,7 +2643,7 @@ function sek_get_parent_level_model( $child_level_id = '', $collection = array()
|
|
2643 |
if ( empty( $collection ) ) {
|
2644 |
if ( empty( $skope_id ) ) {
|
2645 |
if ( is_array( $_POST ) && !empty( $_POST['location_skope_id'] ) ) {
|
2646 |
-
$skope_id = $_POST['location_skope_id'];
|
2647 |
} else {
|
2648 |
// When fired during an ajax 'customize_save' action, the skp_get_skope_id() is determined with $_POST['local_skope_id']
|
2649 |
// @see add_filter( 'skp_get_skope_id', '\Nimble\sek_filter_skp_get_skope_id', 10, 2 );
|
@@ -3021,8 +3021,8 @@ function sek_filter_skp_get_skope_id( $skope_id, $level ) {
|
|
3021 |
// $.extend( query, { local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ) } );
|
3022 |
// });
|
3023 |
// implemented to fix : https://github.com/presscustomizr/nimble-builder/issues/242
|
3024 |
-
if ( 'local' === $level && is_array( $_POST ) && !empty( $_POST['local_skope_id'] ) && 'customize_save' === $_POST['action'] ) {
|
3025 |
-
$skope_id = $_POST['local_skope_id'];
|
3026 |
}
|
3027 |
return $skope_id;
|
3028 |
}
|
@@ -3342,10 +3342,16 @@ function sek_current_user_can_access_nb_ui() {
|
|
3342 |
function sek_clean_transients_like( $transient_string ) {
|
3343 |
global $wpdb;
|
3344 |
$where_like = '%'.$transient_string.'%';
|
|
|
|
|
|
|
|
|
|
|
3345 |
$sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3346 |
FROM $wpdb->options
|
3347 |
-
WHERE `option_name` LIKE
|
3348 |
-
ORDER BY `option_name
|
|
|
3349 |
|
3350 |
$results = $wpdb->get_results( $sql );
|
3351 |
$transients = array();
|
@@ -3388,10 +3394,16 @@ function sek_clean_transients_like( $transient_string ) {
|
|
3388 |
function sek_clean_options_starting_like( $opt_string ) {
|
3389 |
global $wpdb;
|
3390 |
$where_like = '%'.$opt_string.'%';
|
|
|
|
|
|
|
|
|
|
|
3391 |
$sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3392 |
FROM $wpdb->options
|
3393 |
-
WHERE `option_name` LIKE
|
3394 |
ORDER BY `option_name`";
|
|
|
3395 |
|
3396 |
$results = $wpdb->get_results( $sql );
|
3397 |
if ( !is_array( $results ) )
|
@@ -4255,7 +4267,12 @@ function sek_maybe_optimize_options() {
|
|
4255 |
if ( !array_key_exists('fix_skope_opt_autoload_0321', $bw_fixes_options ) || 'done' != $bw_fixes_options['fix_skope_opt_autoload_0321'] ) {
|
4256 |
// MOVE ALL OPTIONS LIKE nimble___skp__post_page_*****, nimble___skp__tax_product_cat_***** in a new option ( NIMBLE_OPT_SEKTION_POST_INDEX ), not autoloaded
|
4257 |
global $wpdb;
|
4258 |
-
$results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE autoload = 'yes' and option_name like 'nimble___skp_%'", ARRAY_A );
|
|
|
|
|
|
|
|
|
|
|
4259 |
if ( is_array( $results ) ) {
|
4260 |
foreach( $results as $old_opt_data ) {
|
4261 |
if ( !is_array($old_opt_data) )
|
@@ -4277,7 +4294,12 @@ function sek_maybe_optimize_options() {
|
|
4277 |
if ( !array_key_exists('move_in_post_index_0321', $bw_fixes_options ) || 'done' != $bw_fixes_options['move_in_post_index_0321'] ) {
|
4278 |
// MOVE ALL OPTIONS LIKE nimble___skp__post_page_*****, nimble___skp__tax_product_cat_***** in a new option ( NIMBLE_OPT_SEKTION_POST_INDEX ), not autoloaded
|
4279 |
global $wpdb;
|
4280 |
-
$
|
|
|
|
|
|
|
|
|
|
|
4281 |
if ( is_array( $results ) ) {
|
4282 |
// Populate the new option ( it should not exists at this point )
|
4283 |
$nb_posts_index = get_option(NIMBLE_OPT_SEKTION_POST_INDEX);
|
314 |
Nimble_Manager()->emitted_js_event = $emitted;
|
315 |
$html = sprintf('<script>(function(){if(window.nb_){nb_.emit("%1$s");}})();</script>', $event );
|
316 |
if ( $echo ) {
|
317 |
+
echo esc_html($html);
|
318 |
} else {
|
319 |
+
return esc_html($html);
|
320 |
}
|
321 |
}
|
322 |
|
803 |
|
804 |
//$menu = apply_filters( 'wp_page_menu', $menu, $args );
|
805 |
if ( $args['echo'] )
|
806 |
+
echo esc_html($menu);
|
807 |
else
|
808 |
+
return esc_html($menu);
|
809 |
}
|
810 |
/**
|
811 |
* Retrieve or display list of pages in list (li) format.
|
858 |
}
|
859 |
$html = apply_filters( 'wp_list_pages', $output, $r );
|
860 |
if ( $r['echo'] ) {
|
861 |
+
echo esc_html($html);
|
862 |
} else {
|
863 |
+
return esc_html($html);
|
864 |
}
|
865 |
}
|
866 |
|
1746 |
if ( 'not_set' === $collection ) {
|
1747 |
if ( empty( $skope_id ) ) {
|
1748 |
if ( is_array( $_POST ) && !empty( $_POST['location_skope_id'] ) ) {
|
1749 |
+
$skope_id = sanitize_text_field( wp_unslash($_POST['location_skope_id']));
|
1750 |
} else {
|
1751 |
// When fired during an ajax 'customize_save' action, the skp_get_skope_id() is determined with $_POST['local_skope_id']
|
1752 |
// @see add_filter( 'skp_get_skope_id', '\Nimble\sek_filter_skp_get_skope_id', 10, 2 );
|
2643 |
if ( empty( $collection ) ) {
|
2644 |
if ( empty( $skope_id ) ) {
|
2645 |
if ( is_array( $_POST ) && !empty( $_POST['location_skope_id'] ) ) {
|
2646 |
+
$skope_id = sanitize_text_field( wp_unslash($_POST['location_skope_id']));
|
2647 |
} else {
|
2648 |
// When fired during an ajax 'customize_save' action, the skp_get_skope_id() is determined with $_POST['local_skope_id']
|
2649 |
// @see add_filter( 'skp_get_skope_id', '\Nimble\sek_filter_skp_get_skope_id', 10, 2 );
|
3021 |
// $.extend( query, { local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ) } );
|
3022 |
// });
|
3023 |
// implemented to fix : https://github.com/presscustomizr/nimble-builder/issues/242
|
3024 |
+
if ( 'local' === $level && is_array( $_POST ) && !empty( $_POST['local_skope_id'] ) && 'customize_save' === sanitize_text_field( wp_unslash($_POST['action'])) ) {
|
3025 |
+
$skope_id = sanitize_text_field( wp_unslash($_POST['local_skope_id']));
|
3026 |
}
|
3027 |
return $skope_id;
|
3028 |
}
|
3342 |
function sek_clean_transients_like( $transient_string ) {
|
3343 |
global $wpdb;
|
3344 |
$where_like = '%'.$transient_string.'%';
|
3345 |
+
// $sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3346 |
+
// FROM $wpdb->options
|
3347 |
+
// WHERE `option_name` LIKE '$where_like'
|
3348 |
+
// ORDER BY `option_name`";
|
3349 |
+
|
3350 |
$sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3351 |
FROM $wpdb->options
|
3352 |
+
WHERE `option_name` LIKE %s
|
3353 |
+
ORDER BY `option_name";
|
3354 |
+
$sql = $wpdb->prepare($sql, array($where_like));
|
3355 |
|
3356 |
$results = $wpdb->get_results( $sql );
|
3357 |
$transients = array();
|
3394 |
function sek_clean_options_starting_like( $opt_string ) {
|
3395 |
global $wpdb;
|
3396 |
$where_like = '%'.$opt_string.'%';
|
3397 |
+
// $sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3398 |
+
// FROM $wpdb->options
|
3399 |
+
// WHERE `option_name` LIKE '$where_like'
|
3400 |
+
// ORDER BY `option_name`";
|
3401 |
+
|
3402 |
$sql = "SELECT `option_name` AS `name`, `option_value` AS `value`
|
3403 |
FROM $wpdb->options
|
3404 |
+
WHERE `option_name` LIKE %s
|
3405 |
ORDER BY `option_name`";
|
3406 |
+
$sql = $wpdb->prepare($sql, array($where_like));
|
3407 |
|
3408 |
$results = $wpdb->get_results( $sql );
|
3409 |
if ( !is_array( $results ) )
|
4267 |
if ( !array_key_exists('fix_skope_opt_autoload_0321', $bw_fixes_options ) || 'done' != $bw_fixes_options['fix_skope_opt_autoload_0321'] ) {
|
4268 |
// MOVE ALL OPTIONS LIKE nimble___skp__post_page_*****, nimble___skp__tax_product_cat_***** in a new option ( NIMBLE_OPT_SEKTION_POST_INDEX ), not autoloaded
|
4269 |
global $wpdb;
|
4270 |
+
// $results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE autoload = 'yes' and option_name like 'nimble___skp_%'", ARRAY_A );
|
4271 |
+
|
4272 |
+
$tablename = $wpdb->prefix . "options";
|
4273 |
+
|
4274 |
+
$sql = $wpdb->prepare( "SELECT * FROM %s WHERE autoload = 'yes' and option_name like 'nimble___skp_%'",$tablename );
|
4275 |
+
$results = $wpdb->get_results( $sql , ARRAY_A );
|
4276 |
if ( is_array( $results ) ) {
|
4277 |
foreach( $results as $old_opt_data ) {
|
4278 |
if ( !is_array($old_opt_data) )
|
4294 |
if ( !array_key_exists('move_in_post_index_0321', $bw_fixes_options ) || 'done' != $bw_fixes_options['move_in_post_index_0321'] ) {
|
4295 |
// MOVE ALL OPTIONS LIKE nimble___skp__post_page_*****, nimble___skp__tax_product_cat_***** in a new option ( NIMBLE_OPT_SEKTION_POST_INDEX ), not autoloaded
|
4296 |
global $wpdb;
|
4297 |
+
$tablename = $wpdb->prefix . "options";
|
4298 |
+
|
4299 |
+
$sql = $wpdb->prepare( "SELECT * FROM %s WHERE autoload = 'yes' and option_name like 'nimble___skp_%'",$tablename );
|
4300 |
+
|
4301 |
+
$results = $wpdb->get_results( $sql , ARRAY_A );
|
4302 |
+
// $results = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}options WHERE autoload = 'yes' and option_name like 'nimble___skp_%'", ARRAY_A );
|
4303 |
if ( is_array( $results ) ) {
|
4304 |
// Populate the new option ( it should not exists at this point )
|
4305 |
$nb_posts_index = get_option(NIMBLE_OPT_SEKTION_POST_INDEX);
|
inc/sektions/ccat-czr-sektions.php
CHANGED
@@ -757,7 +757,7 @@ function sek_print_nimble_czr_control_js() {
|
|
757 |
wp.customize.apiIsReady = true; //<= used in CZRSeksPrototype::initialize()
|
758 |
var _script = document.createElement("script"),
|
759 |
customizePreviewTag = document.getElementById('customize-preview');
|
760 |
-
_script.setAttribute('src', '<?php echo $script_url; ?>' );
|
761 |
_script.setAttribute('id', 'nb-control-js' );
|
762 |
//_script.setAttribute('defer', 'defer');
|
763 |
|
@@ -835,7 +835,7 @@ function sek_print_nimble_customizer_tmpl() {
|
|
835 |
<?php endif; ?>
|
836 |
</div>
|
837 |
<div class="sek-nimble-doc" data-doc-href="https://docs.presscustomizr.com/collection/334-nimble-builder/?utm_source=usersite&utm_medium=link&utm_campaign=nimble-customizer-topbar">
|
838 |
-
<div class="sek-nimble-icon"><img src="<?php echo NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION; ?>" alt="<?php _e('Nimble Builder','nimble-builder'); ?>" title="<?php _e('Knowledge base', 'nimble-builder'); ?>"/></div>
|
839 |
<span class="sek-pointer" title="<?php _e('Knowledge base', 'nimble-builder'); ?>"><?php _e('Knowledge base', 'nimble-builder'); ?></span>
|
840 |
<button class="far fa-question-circle" type="button" title="<?php _e('Knowledge base', 'nimble-builder'); ?>" data-nimble-state="enabled">
|
841 |
<span class="screen-reader-text"><?php _e('Knowledge base', 'nimble-builder'); ?></span>
|
@@ -1690,7 +1690,7 @@ function sek_print_nimble_input_templates() {
|
|
1690 |
'is_pro' : false
|
1691 |
},
|
1692 |
modData = jQuery.extend( defaultModParams, modData );
|
1693 |
-
var _assets_version = "<?php echo NIMBLE_ASSETS_VERSION; ?>";
|
1694 |
if ( !_.isEmpty( modData['icon'] ) ) {
|
1695 |
if ( 'http' === modData['icon'].substring(0, 4) ) {
|
1696 |
icon_img_src = modData['icon'];
|
@@ -2356,7 +2356,7 @@ final class _NIMBLE_Editors {
|
|
2356 |
$wrap_class .= ' has-dfw';
|
2357 |
}
|
2358 |
|
2359 |
-
echo '<div id="wp-' . $editor_id_attr . '-wrap" class="' . $wrap_class . '">';
|
2360 |
|
2361 |
if ( self::$editor_buttons_css ) {
|
2362 |
wp_print_styles( 'editor-buttons' );
|
@@ -2364,11 +2364,11 @@ final class _NIMBLE_Editors {
|
|
2364 |
}
|
2365 |
|
2366 |
if ( !empty( $set['editor_css'] ) ) {
|
2367 |
-
echo $set['editor_css'] . "\n";
|
2368 |
}
|
2369 |
|
2370 |
if ( !empty( $buttons ) || $set['media_buttons'] ) {
|
2371 |
-
echo '<div id="wp-' . $editor_id_attr . '-editor-tools" class="wp-editor-tools hide-if-no-js">';
|
2372 |
|
2373 |
if ( $set['media_buttons'] ) {
|
2374 |
self::$has_medialib = true;
|
@@ -2377,7 +2377,7 @@ final class _NIMBLE_Editors {
|
|
2377 |
include( ABSPATH . 'wp-admin/includes/media.php' );
|
2378 |
}
|
2379 |
|
2380 |
-
echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">';
|
2381 |
|
2382 |
/**
|
2383 |
* Fires after the default media button(s) are displayed.
|
@@ -2387,11 +2387,11 @@ final class _NIMBLE_Editors {
|
|
2387 |
* @param string $editor_id Unique editor identifier, e.g. 'content'.
|
2388 |
*/
|
2389 |
do_action( 'media_buttons', $editor_id );
|
2390 |
-
echo "</div>\n";
|
2391 |
}
|
2392 |
|
2393 |
-
echo '<div class="wp-editor-tabs">' . $buttons . "</div>\n";
|
2394 |
-
echo "</div>\n";
|
2395 |
}
|
2396 |
|
2397 |
$quicktags_toolbar = '';
|
@@ -2456,7 +2456,7 @@ final class _NIMBLE_Editors {
|
|
2456 |
}
|
2457 |
|
2458 |
printf( $the_editor, $content );
|
2459 |
-
echo "\n</div>\n\n";
|
2460 |
|
2461 |
self::editor_settings( $editor_id, $set );
|
2462 |
}
|
@@ -3039,7 +3039,7 @@ final class _NIMBLE_Editors {
|
|
3039 |
window.wp.editor = window.wp.editor || {};
|
3040 |
window.wp.editor.getDefaultSettings = function() {
|
3041 |
return {
|
3042 |
-
tinymce: <?php echo $settings; ?>,
|
3043 |
quicktags: {
|
3044 |
buttons: 'strong,em,link,ul,ol,li,code'
|
3045 |
}
|
@@ -3054,8 +3054,8 @@ final class _NIMBLE_Editors {
|
|
3054 |
|
3055 |
?>
|
3056 |
var nimbleTinyMCEPreInit = {
|
3057 |
-
baseURL: "<?php echo $baseurl; ?>",
|
3058 |
-
suffix: "<?php echo $suffix; ?>",
|
3059 |
mceInit: {},
|
3060 |
qtInit: {},
|
3061 |
load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
|
@@ -3597,7 +3597,7 @@ final class _NIMBLE_Editors {
|
|
3597 |
|
3598 |
wp_print_scripts( array( 'wp-tinymce' ) );
|
3599 |
|
3600 |
-
echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
|
3601 |
}
|
3602 |
|
3603 |
/**
|
@@ -3653,8 +3653,8 @@ final class _NIMBLE_Editors {
|
|
3653 |
|
3654 |
<script type="text/javascript">
|
3655 |
nimbleTinyMCEPreInit = {
|
3656 |
-
baseURL: "<?php echo $baseurl; ?>",
|
3657 |
-
suffix: "<?php echo $suffix; ?>",
|
3658 |
<?php
|
3659 |
|
3660 |
if ( self::$drag_drop_upload ) {
|
@@ -3675,7 +3675,7 @@ final class _NIMBLE_Editors {
|
|
3675 |
|
3676 |
if ( self::$ext_plugins ) {
|
3677 |
// Load the old-format English strings to prevent unsightly labels in old style popups
|
3678 |
-
echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n";
|
3679 |
}
|
3680 |
}
|
3681 |
|
@@ -3694,11 +3694,12 @@ final class _NIMBLE_Editors {
|
|
3694 |
<?php
|
3695 |
|
3696 |
if ( self::$ext_plugins ) {
|
3697 |
-
echo self::$ext_plugins . "\n";
|
3698 |
}
|
3699 |
|
|
|
3700 |
if ( !is_admin() ) {
|
3701 |
-
echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
|
3702 |
}
|
3703 |
|
3704 |
?>
|
@@ -3999,9 +4000,9 @@ function sek_ajax_import_attachment() {
|
|
3999 |
wp_send_json_error( 'missing_or_invalid_img_url_when_importing_image');
|
4000 |
}
|
4001 |
|
4002 |
-
$id = sek_sideload_img_and_return_attachment_id( $_POST['img_url'] );
|
4003 |
if ( is_wp_error( $id ) ) {
|
4004 |
-
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => problem when trying to wp_insert_attachment() for img : ' . $_POST['img_url'] . ' | SERVER ERROR => ' . json_encode( $id ) );
|
4005 |
} else {
|
4006 |
wp_send_json_success([
|
4007 |
'id' => $id,
|
@@ -4023,7 +4024,7 @@ function sek_get_revision_history() {
|
|
4023 |
if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4024 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing skope_id' );
|
4025 |
}
|
4026 |
-
$rev_list = sek_get_revision_history_from_posts( $_POST['skope_id'] );
|
4027 |
wp_send_json_success( $rev_list );
|
4028 |
}
|
4029 |
|
@@ -4034,7 +4035,7 @@ function sek_get_single_revision() {
|
|
4034 |
if ( !isset( $_POST['revision_post_id'] ) || empty( $_POST['revision_post_id'] ) ) {
|
4035 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing revision_post_id' );
|
4036 |
}
|
4037 |
-
$revision = sek_get_single_post_revision( $_POST['revision_post_id'] );
|
4038 |
wp_send_json_success( $revision );
|
4039 |
}
|
4040 |
|
@@ -4310,10 +4311,10 @@ function sek_maybe_export() {
|
|
4310 |
$export = array(
|
4311 |
'data' => $seks_data,
|
4312 |
'metas' => array(
|
4313 |
-
'skope_id' => $_REQUEST['skope_id'],
|
4314 |
'version' => NIMBLE_VERSION,
|
4315 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
4316 |
-
'active_locations' => is_string( $_REQUEST['active_locations'] ) ? explode( ',', $_REQUEST['active_locations'] ) : array(),
|
4317 |
'date' => date("Y-m-d"),
|
4318 |
'theme' => $theme_name
|
4319 |
)
|
@@ -4321,7 +4322,7 @@ function sek_maybe_export() {
|
|
4321 |
|
4322 |
//sek_error_log('$export ?', $export );
|
4323 |
|
4324 |
-
$skope_id = str_replace('skp__', '', $_REQUEST['skope_id'] );
|
4325 |
$filename = $theme_name . '_' . $skope_id . '.nimblebuilder';
|
4326 |
|
4327 |
// Set the download headers.
|
@@ -4497,11 +4498,11 @@ function sek_ajax_get_manually_imported_file_content() {
|
|
4497 |
|
4498 |
$maybe_import_images = true;
|
4499 |
// in a pre-import-check context, we don't need to sniff and upload images
|
4500 |
-
if ( array_key_exists( 'pre_import_check', $_POST ) && true === sek_booleanize_checkbox_val( $_POST['pre_import_check'] ) ) {
|
4501 |
$maybe_import_images = false;
|
4502 |
}
|
4503 |
// april 2020 : introduced for https://github.com/presscustomizr/nimble-builder/issues/663
|
4504 |
-
if ( array_key_exists( 'import_img', $_POST ) && false === sek_booleanize_checkbox_val( $_POST['import_img'] ) ) {
|
4505 |
$maybe_import_images = false;
|
4506 |
}
|
4507 |
|
@@ -4580,7 +4581,7 @@ function sek_ajax_sek_get_user_tmpl_json() {
|
|
4580 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4581 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4582 |
// }
|
4583 |
-
$tmpl_post = sek_get_saved_tmpl_post( $_POST['tmpl_post_name'] );
|
4584 |
if ( !is_wp_error( $tmpl_post ) && $tmpl_post && is_object( $tmpl_post ) ) {
|
4585 |
$tmpl_decoded = maybe_unserialize( $tmpl_post->post_content );
|
4586 |
|
@@ -4634,10 +4635,10 @@ function sek_ajax_sek_get_api_tmpl_json() {
|
|
4634 |
if ( empty( $_POST['api_tmpl_name']) || !is_string( $_POST['api_tmpl_name'] ) ) {
|
4635 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_post_name' );
|
4636 |
}
|
4637 |
-
$tmpl_name = $_POST['api_tmpl_name'];
|
4638 |
|
4639 |
// Pro Template case
|
4640 |
-
$is_pro_tmpl = array_key_exists('api_tmpl_is_pro', $_POST ) && 'yes' === $_POST['api_tmpl_is_pro'];
|
4641 |
if ( $is_pro_tmpl ) {
|
4642 |
$pro_key_status = apply_filters( 'nimble_pro_key_status_OK', 'nok' );
|
4643 |
if ( 'pro_key_status_ok' !== $pro_key_status ) {
|
@@ -4688,7 +4689,7 @@ add_action( 'wp_ajax_sek_save_user_template', '\Nimble\sek_ajax_save_user_templa
|
|
4688 |
// hook : wp_ajax_sek_save_user_template
|
4689 |
function sek_ajax_save_user_template() {
|
4690 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4691 |
-
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === $_POST['edit_metas_only'];
|
4692 |
|
4693 |
// TMPL DATA => the nimble content
|
4694 |
if ( !$is_edit_metas_only_case && empty( $_POST['tmpl_data']) ) {
|
@@ -4737,12 +4738,12 @@ function sek_ajax_save_user_template() {
|
|
4737 |
'metas' => array(
|
4738 |
'title' => $tmpl_title,
|
4739 |
'description' => $tmpl_description,
|
4740 |
-
'skope_id' => $_POST['skope_id'],
|
4741 |
'version' => NIMBLE_VERSION,
|
4742 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
4743 |
-
'tmpl_locations' => is_array( $_POST['tmpl_locations'] ) ? $_POST['tmpl_locations'] : array(),
|
4744 |
-
'tmpl_header_location' => isset( $_POST['tmpl_header_location'] ) ? $_POST['tmpl_header_location'] : '',
|
4745 |
-
'tmpl_footer_location' => isset( $_POST['tmpl_footer_location'] ) ?
|
4746 |
'date' => date("Y-m-d"),
|
4747 |
'theme' => sanitize_title_with_dashes( get_stylesheet() ),
|
4748 |
// for api templates
|
@@ -4809,7 +4810,7 @@ function sek_ajax_remove_user_template() {
|
|
4809 |
if ( empty( $_POST['tmpl_post_name']) || !is_string( $_POST['tmpl_post_name'] ) ) {
|
4810 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_post_name' );
|
4811 |
}
|
4812 |
-
$tmpl_post_name = $_POST['tmpl_post_name'];
|
4813 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4814 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4815 |
// }
|
@@ -4879,7 +4880,7 @@ function sek_ajax_get_single_api_section_data() {
|
|
4879 |
if ( empty( $_POST['api_section_id']) || !is_string( $_POST['api_section_id'] ) ) {
|
4880 |
wp_send_json_error( __FUNCTION__ . '_missing_api_section_id' );
|
4881 |
}
|
4882 |
-
$api_section_id = $_POST['api_section_id'];
|
4883 |
|
4884 |
$is_pro_section_id = sek_is_pro() && is_string($api_section_id) && 'pro_' === substr($api_section_id,0,4);
|
4885 |
$pro_key_status = apply_filters( 'nimble_pro_key_status_OK', 'nok' );
|
@@ -4938,7 +4939,7 @@ function sek_ajax_sek_get_user_section_json() {
|
|
4938 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4939 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4940 |
// }
|
4941 |
-
$section_post = sek_get_saved_section_post( $_POST['section_post_name'] );
|
4942 |
if ( !is_wp_error( $section_post ) && $section_post && is_object( $section_post ) ) {
|
4943 |
$section_decoded = maybe_unserialize( $section_post->post_content );
|
4944 |
// Structure of $content :
|
@@ -4982,7 +4983,7 @@ add_action( 'wp_ajax_sek_save_user_section', '\Nimble\sek_ajax_save_user_section
|
|
4982 |
// hook : wp_ajax_sek_save_user_section
|
4983 |
function sek_ajax_save_user_section() {
|
4984 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4985 |
-
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === $_POST['edit_metas_only'];
|
4986 |
// TMPL DATA => the nimble content
|
4987 |
if ( !$is_edit_metas_only_case && empty( $_POST['section_data']) ) {
|
4988 |
wp_send_json_error( __FUNCTION__ . '_missing_section_data' );
|
@@ -5015,8 +5016,8 @@ function sek_ajax_save_user_section() {
|
|
5015 |
}
|
5016 |
|
5017 |
// make sure description and title are clean before DB
|
5018 |
-
$sec_title = sek_maybe_encode_richtext( $_POST['section_title'] );
|
5019 |
-
$sec_description = sek_maybe_encode_richtext( $_POST['section_description'] );
|
5020 |
|
5021 |
$section_to_save = array(
|
5022 |
'data' => $seks_data,//<= json stringified
|
@@ -5025,7 +5026,7 @@ function sek_ajax_save_user_section() {
|
|
5025 |
'metas' => array(
|
5026 |
'title' => $sec_title,
|
5027 |
'description' => $sec_description,
|
5028 |
-
'skope_id' => $_POST['skope_id'],
|
5029 |
'version' => NIMBLE_VERSION,
|
5030 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
5031 |
//'active_locations' => is_array( $_POST['active_locations'] ) ? $_POST['active_locations'] : array(),
|
@@ -5086,7 +5087,7 @@ function sek_ajax_remove_user_section() {
|
|
5086 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
5087 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
5088 |
// }
|
5089 |
-
$section_post_to_remove = sek_get_saved_section_post( $_POST['section_post_name'] );
|
5090 |
|
5091 |
if ( $section_post_to_remove && is_object( $section_post_to_remove ) ) {
|
5092 |
// the CPT is moved to Trash instead of permanently deleted when using wp_delete_post()
|
@@ -5101,7 +5102,7 @@ function sek_ajax_remove_user_section() {
|
|
5101 |
if ( is_wp_error( $section_post_to_remove ) || is_null($section_post_to_remove) || empty($section_post_to_remove) ) {
|
5102 |
wp_send_json_error( __FUNCTION__ . '_removal_error' );
|
5103 |
} else {
|
5104 |
-
wp_send_json_success( [ 'section_post_removed' => $_POST['section_post_name'] ] );
|
5105 |
}
|
5106 |
}
|
5107 |
?><?php
|
757 |
wp.customize.apiIsReady = true; //<= used in CZRSeksPrototype::initialize()
|
758 |
var _script = document.createElement("script"),
|
759 |
customizePreviewTag = document.getElementById('customize-preview');
|
760 |
+
_script.setAttribute('src', '<?php echo esc_url($script_url); ?>' );
|
761 |
_script.setAttribute('id', 'nb-control-js' );
|
762 |
//_script.setAttribute('defer', 'defer');
|
763 |
|
835 |
<?php endif; ?>
|
836 |
</div>
|
837 |
<div class="sek-nimble-doc" data-doc-href="https://docs.presscustomizr.com/collection/334-nimble-builder/?utm_source=usersite&utm_medium=link&utm_campaign=nimble-customizer-topbar">
|
838 |
+
<div class="sek-nimble-icon"><img src="<?php echo esc_url(NIMBLE_BASE_URL.'/assets/img/nimble/nimble_icon.svg?ver='.NIMBLE_VERSION); ?>" alt="<?php _e('Nimble Builder','nimble-builder'); ?>" title="<?php _e('Knowledge base', 'nimble-builder'); ?>"/></div>
|
839 |
<span class="sek-pointer" title="<?php _e('Knowledge base', 'nimble-builder'); ?>"><?php _e('Knowledge base', 'nimble-builder'); ?></span>
|
840 |
<button class="far fa-question-circle" type="button" title="<?php _e('Knowledge base', 'nimble-builder'); ?>" data-nimble-state="enabled">
|
841 |
<span class="screen-reader-text"><?php _e('Knowledge base', 'nimble-builder'); ?></span>
|
1690 |
'is_pro' : false
|
1691 |
},
|
1692 |
modData = jQuery.extend( defaultModParams, modData );
|
1693 |
+
var _assets_version = "<?php echo esc_attr(NIMBLE_ASSETS_VERSION); ?>";
|
1694 |
if ( !_.isEmpty( modData['icon'] ) ) {
|
1695 |
if ( 'http' === modData['icon'].substring(0, 4) ) {
|
1696 |
icon_img_src = modData['icon'];
|
2356 |
$wrap_class .= ' has-dfw';
|
2357 |
}
|
2358 |
|
2359 |
+
echo esc_html('<div id="wp-' . $editor_id_attr . '-wrap" class="' . $wrap_class . '">');
|
2360 |
|
2361 |
if ( self::$editor_buttons_css ) {
|
2362 |
wp_print_styles( 'editor-buttons' );
|
2364 |
}
|
2365 |
|
2366 |
if ( !empty( $set['editor_css'] ) ) {
|
2367 |
+
echo esc_html($set['editor_css']) . "\n";
|
2368 |
}
|
2369 |
|
2370 |
if ( !empty( $buttons ) || $set['media_buttons'] ) {
|
2371 |
+
echo esc_html('<div id="wp-' . $editor_id_attr . '-editor-tools" class="wp-editor-tools hide-if-no-js">');
|
2372 |
|
2373 |
if ( $set['media_buttons'] ) {
|
2374 |
self::$has_medialib = true;
|
2377 |
include( ABSPATH . 'wp-admin/includes/media.php' );
|
2378 |
}
|
2379 |
|
2380 |
+
echo esc_html('<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">');
|
2381 |
|
2382 |
/**
|
2383 |
* Fires after the default media button(s) are displayed.
|
2387 |
* @param string $editor_id Unique editor identifier, e.g. 'content'.
|
2388 |
*/
|
2389 |
do_action( 'media_buttons', $editor_id );
|
2390 |
+
echo esc_html("</div>\n");
|
2391 |
}
|
2392 |
|
2393 |
+
echo esc_html('<div class="wp-editor-tabs">' . $buttons . "</div>\n");
|
2394 |
+
echo esc_html("</div>\n");
|
2395 |
}
|
2396 |
|
2397 |
$quicktags_toolbar = '';
|
2456 |
}
|
2457 |
|
2458 |
printf( $the_editor, $content );
|
2459 |
+
echo esc_html("\n</div>\n\n");
|
2460 |
|
2461 |
self::editor_settings( $editor_id, $set );
|
2462 |
}
|
3039 |
window.wp.editor = window.wp.editor || {};
|
3040 |
window.wp.editor.getDefaultSettings = function() {
|
3041 |
return {
|
3042 |
+
tinymce: <?php echo esc_attr($settings); ?>,
|
3043 |
quicktags: {
|
3044 |
buttons: 'strong,em,link,ul,ol,li,code'
|
3045 |
}
|
3054 |
|
3055 |
?>
|
3056 |
var nimbleTinyMCEPreInit = {
|
3057 |
+
baseURL: "<?php echo esc_url($baseurl); ?>",
|
3058 |
+
suffix: "<?php echo esc_attr($suffix); ?>",
|
3059 |
mceInit: {},
|
3060 |
qtInit: {},
|
3061 |
load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
|
3597 |
|
3598 |
wp_print_scripts( array( 'wp-tinymce' ) );
|
3599 |
|
3600 |
+
echo esc_js("<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n");
|
3601 |
}
|
3602 |
|
3603 |
/**
|
3653 |
|
3654 |
<script type="text/javascript">
|
3655 |
nimbleTinyMCEPreInit = {
|
3656 |
+
baseURL: "<?php echo esc_url($baseurl); ?>",
|
3657 |
+
suffix: "<?php echo esc_attr($suffix); ?>",
|
3658 |
<?php
|
3659 |
|
3660 |
if ( self::$drag_drop_upload ) {
|
3675 |
|
3676 |
if ( self::$ext_plugins ) {
|
3677 |
// Load the old-format English strings to prevent unsightly labels in old style popups
|
3678 |
+
echo esc_js("<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n");
|
3679 |
}
|
3680 |
}
|
3681 |
|
3694 |
<?php
|
3695 |
|
3696 |
if ( self::$ext_plugins ) {
|
3697 |
+
echo esc_js(self::$ext_plugins . "\n");
|
3698 |
}
|
3699 |
|
3700 |
+
// NeedClarificatin
|
3701 |
if ( !is_admin() ) {
|
3702 |
+
echo esc_js('var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";');
|
3703 |
}
|
3704 |
|
3705 |
?>
|
4000 |
wp_send_json_error( 'missing_or_invalid_img_url_when_importing_image');
|
4001 |
}
|
4002 |
|
4003 |
+
$id = sek_sideload_img_and_return_attachment_id( sanitize_url($_POST['img_url']) );
|
4004 |
if ( is_wp_error( $id ) ) {
|
4005 |
+
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => problem when trying to wp_insert_attachment() for img : ' . sanitize_url($_POST['img_url']) . ' | SERVER ERROR => ' . json_encode( $id ) );
|
4006 |
} else {
|
4007 |
wp_send_json_success([
|
4008 |
'id' => $id,
|
4024 |
if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4025 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing skope_id' );
|
4026 |
}
|
4027 |
+
$rev_list = sek_get_revision_history_from_posts( sanitize_text_field($_POST['skope_id']) );
|
4028 |
wp_send_json_success( $rev_list );
|
4029 |
}
|
4030 |
|
4035 |
if ( !isset( $_POST['revision_post_id'] ) || empty( $_POST['revision_post_id'] ) ) {
|
4036 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing revision_post_id' );
|
4037 |
}
|
4038 |
+
$revision = sek_get_single_post_revision( sanitize_text_field($_POST['revision_post_id']) );
|
4039 |
wp_send_json_success( $revision );
|
4040 |
}
|
4041 |
|
4311 |
$export = array(
|
4312 |
'data' => $seks_data,
|
4313 |
'metas' => array(
|
4314 |
+
'skope_id' => sanitize_text_field($_REQUEST['skope_id']),
|
4315 |
'version' => NIMBLE_VERSION,
|
4316 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
4317 |
+
'active_locations' => is_string( $_REQUEST['active_locations'] ) ? explode( ',', sanitize_text_field($_REQUEST['active_locations']) ) : array(),
|
4318 |
'date' => date("Y-m-d"),
|
4319 |
'theme' => $theme_name
|
4320 |
)
|
4322 |
|
4323 |
//sek_error_log('$export ?', $export );
|
4324 |
|
4325 |
+
$skope_id = str_replace('skp__', '', sanitize_text_field($_REQUEST['skope_id']) );
|
4326 |
$filename = $theme_name . '_' . $skope_id . '.nimblebuilder';
|
4327 |
|
4328 |
// Set the download headers.
|
4498 |
|
4499 |
$maybe_import_images = true;
|
4500 |
// in a pre-import-check context, we don't need to sniff and upload images
|
4501 |
+
if ( array_key_exists( 'pre_import_check', $_POST ) && true === sek_booleanize_checkbox_val( sanitize_text_field($_POST['pre_import_check']) ) ) {
|
4502 |
$maybe_import_images = false;
|
4503 |
}
|
4504 |
// april 2020 : introduced for https://github.com/presscustomizr/nimble-builder/issues/663
|
4505 |
+
if ( array_key_exists( 'import_img', $_POST ) && false === sek_booleanize_checkbox_val( sanitize_text_field($_POST['import_img']) ) ) {
|
4506 |
$maybe_import_images = false;
|
4507 |
}
|
4508 |
|
4581 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4582 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4583 |
// }
|
4584 |
+
$tmpl_post = sek_get_saved_tmpl_post( sanitize_text_field($_POST['tmpl_post_name']) );
|
4585 |
if ( !is_wp_error( $tmpl_post ) && $tmpl_post && is_object( $tmpl_post ) ) {
|
4586 |
$tmpl_decoded = maybe_unserialize( $tmpl_post->post_content );
|
4587 |
|
4635 |
if ( empty( $_POST['api_tmpl_name']) || !is_string( $_POST['api_tmpl_name'] ) ) {
|
4636 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_post_name' );
|
4637 |
}
|
4638 |
+
$tmpl_name = sanitize_text_field($_POST['api_tmpl_name']);
|
4639 |
|
4640 |
// Pro Template case
|
4641 |
+
$is_pro_tmpl = array_key_exists('api_tmpl_is_pro', $_POST ) && 'yes' === sanitize_text_field($_POST['api_tmpl_is_pro']);
|
4642 |
if ( $is_pro_tmpl ) {
|
4643 |
$pro_key_status = apply_filters( 'nimble_pro_key_status_OK', 'nok' );
|
4644 |
if ( 'pro_key_status_ok' !== $pro_key_status ) {
|
4689 |
// hook : wp_ajax_sek_save_user_template
|
4690 |
function sek_ajax_save_user_template() {
|
4691 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4692 |
+
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === sanitize_text_field($_POST['edit_metas_only']);
|
4693 |
|
4694 |
// TMPL DATA => the nimble content
|
4695 |
if ( !$is_edit_metas_only_case && empty( $_POST['tmpl_data']) ) {
|
4738 |
'metas' => array(
|
4739 |
'title' => $tmpl_title,
|
4740 |
'description' => $tmpl_description,
|
4741 |
+
'skope_id' => sanitize_text_field($_POST['skope_id']),
|
4742 |
'version' => NIMBLE_VERSION,
|
4743 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
4744 |
+
'tmpl_locations' => is_array( $_POST['tmpl_locations'] ) ? array_map( 'esc_attr', $_POST['tmpl_locations'] ) : array(),
|
4745 |
+
'tmpl_header_location' => isset( $_POST['tmpl_header_location'] ) ? array_map( 'esc_attr', $_POST['tmpl_header_location'] ) : '',
|
4746 |
+
'tmpl_footer_location' => isset( $_POST['tmpl_footer_location'] ) ? array_map( 'esc_attr',$_POST['tmpl_footer_location'] ) : '',
|
4747 |
'date' => date("Y-m-d"),
|
4748 |
'theme' => sanitize_title_with_dashes( get_stylesheet() ),
|
4749 |
// for api templates
|
4810 |
if ( empty( $_POST['tmpl_post_name']) || !is_string( $_POST['tmpl_post_name'] ) ) {
|
4811 |
wp_send_json_error( __FUNCTION__ . '_missing_tmpl_post_name' );
|
4812 |
}
|
4813 |
+
$tmpl_post_name = sanitize_text_field($_POST['tmpl_post_name']);
|
4814 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4815 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4816 |
// }
|
4880 |
if ( empty( $_POST['api_section_id']) || !is_string( $_POST['api_section_id'] ) ) {
|
4881 |
wp_send_json_error( __FUNCTION__ . '_missing_api_section_id' );
|
4882 |
}
|
4883 |
+
$api_section_id = sanitize_text_field($_POST['api_section_id']);
|
4884 |
|
4885 |
$is_pro_section_id = sek_is_pro() && is_string($api_section_id) && 'pro_' === substr($api_section_id,0,4);
|
4886 |
$pro_key_status = apply_filters( 'nimble_pro_key_status_OK', 'nok' );
|
4939 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
4940 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
4941 |
// }
|
4942 |
+
$section_post = sek_get_saved_section_post( sanitize_text_field($_POST['section_post_name']) );
|
4943 |
if ( !is_wp_error( $section_post ) && $section_post && is_object( $section_post ) ) {
|
4944 |
$section_decoded = maybe_unserialize( $section_post->post_content );
|
4945 |
// Structure of $content :
|
4983 |
// hook : wp_ajax_sek_save_user_section
|
4984 |
function sek_ajax_save_user_section() {
|
4985 |
sek_do_ajax_pre_checks( array( 'check_nonce' => true ) );
|
4986 |
+
$is_edit_metas_only_case = isset( $_POST['edit_metas_only'] ) && 'yes' === sanitize_text_field($_POST['edit_metas_only']);
|
4987 |
// TMPL DATA => the nimble content
|
4988 |
if ( !$is_edit_metas_only_case && empty( $_POST['section_data']) ) {
|
4989 |
wp_send_json_error( __FUNCTION__ . '_missing_section_data' );
|
5016 |
}
|
5017 |
|
5018 |
// make sure description and title are clean before DB
|
5019 |
+
$sec_title = sek_maybe_encode_richtext( sanitize_text_field($_POST['section_title']) );
|
5020 |
+
$sec_description = sek_maybe_encode_richtext( sanitize_text_field($_POST['section_description']) );
|
5021 |
|
5022 |
$section_to_save = array(
|
5023 |
'data' => $seks_data,//<= json stringified
|
5026 |
'metas' => array(
|
5027 |
'title' => $sec_title,
|
5028 |
'description' => $sec_description,
|
5029 |
+
'skope_id' => sanitize_text_field($_POST['skope_id']),
|
5030 |
'version' => NIMBLE_VERSION,
|
5031 |
// is sent as a string : "__after_header,__before_main_wrapper,loop_start,__before_footer"
|
5032 |
//'active_locations' => is_array( $_POST['active_locations'] ) ? $_POST['active_locations'] : array(),
|
5087 |
// if ( !isset( $_POST['skope_id'] ) || empty( $_POST['skope_id'] ) ) {
|
5088 |
// wp_send_json_error( __FUNCTION__ . '_missing_skope_id' );
|
5089 |
// }
|
5090 |
+
$section_post_to_remove = sek_get_saved_section_post( sanitize_text_field($_POST['section_post_name']) );
|
5091 |
|
5092 |
if ( $section_post_to_remove && is_object( $section_post_to_remove ) ) {
|
5093 |
// the CPT is moved to Trash instead of permanently deleted when using wp_delete_post()
|
5102 |
if ( is_wp_error( $section_post_to_remove ) || is_null($section_post_to_remove) || empty($section_post_to_remove) ) {
|
5103 |
wp_send_json_error( __FUNCTION__ . '_removal_error' );
|
5104 |
} else {
|
5105 |
+
wp_send_json_success( [ 'section_post_removed' => sanitize_text_field($_POST['section_post_name']) ] );
|
5106 |
}
|
5107 |
}
|
5108 |
?><?php
|
inc/sektions/ccat-sektions-base.php
CHANGED
@@ -52,7 +52,7 @@ class Sek_Dyn_CSS_Builder {
|
|
52 |
// June 2020 : this property is set when saving the customizer
|
53 |
// and used to determine if we need to generate css for a given location
|
54 |
// typically useful when a local header is populated with sections but not used on the page. While still present in the collection of location, we don't want to generate css for it.
|
55 |
-
$this->customizer_active_locations = ( isset($_POST['active_locations']) && is_array($_POST['active_locations']) ) ? $_POST['active_locations'] : '_not_set_';
|
56 |
|
57 |
$this->is_global_stylesheet = $is_global_stylesheet;
|
58 |
// set the css rules for columns
|
@@ -2659,7 +2659,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2659 |
if ( !isset( $_POST['sek_action'] ) || empty( $_POST['sek_action'] ) ) {
|
2660 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing sek_action' );
|
2661 |
}
|
2662 |
-
$sek_action = $_POST['sek_action'];
|
2663 |
|
2664 |
$exported_setting_validities = array();
|
2665 |
|
@@ -2687,7 +2687,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2687 |
if ( in_array( $sek_action, $this->ajax_action_map ) ) {
|
2688 |
$content_type = null;
|
2689 |
if ( array_key_exists( 'content_type', $_POST ) && is_string( $_POST['content_type'] ) ) {
|
2690 |
-
$content_type = $_POST['content_type'];
|
2691 |
}
|
2692 |
|
2693 |
// This 'preset_section' === $content_type statement has been introduced when implementing support for multi-section pre-build sections
|
@@ -2695,7 +2695,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2695 |
if ( 'preset_section' === $content_type ) {
|
2696 |
$collection_of_preset_section_id = null;
|
2697 |
if ( array_key_exists( 'collection_of_preset_section_id', $_POST ) && is_array( $_POST['collection_of_preset_section_id'] ) ) {
|
2698 |
-
$collection_of_preset_section_id = $_POST['collection_of_preset_section_id'];
|
2699 |
}
|
2700 |
|
2701 |
switch ( $sek_action ) {
|
@@ -2769,7 +2769,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2769 |
// c) then when ajaxing, the $_POST['customized'] param is added by WP core with $.ajaxPrefilter() in customize-preview.js
|
2770 |
//
|
2771 |
// 2) since 'wp' hook has not been fired yet, we need to use the posted skope_id param.
|
2772 |
-
$sektionSettingValue = sek_get_skoped_seks( $_POST['location_skope_id'] );
|
2773 |
if ( !is_array( $sektionSettingValue ) ) {
|
2774 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => invalid sektionSettingValue => it should be an array().' );
|
2775 |
return;
|
@@ -2795,11 +2795,11 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2795 |
case 'sek-duplicate-section' :
|
2796 |
if ( array_key_exists( 'is_nested', $_POST ) && true === json_decode( $_POST['is_nested'] ) ) {
|
2797 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2798 |
-
$this->parent_model = sek_get_level_model( $_POST[ 'in_sektion' ], $sektion_collection );
|
2799 |
-
$level_model = sek_get_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2800 |
} else {
|
2801 |
//$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2802 |
-
$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2803 |
}
|
2804 |
break;
|
2805 |
|
@@ -2810,7 +2810,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2810 |
case 'sek-add-content-in-new-nested-sektion' :
|
2811 |
$content_type = null;
|
2812 |
if ( array_key_exists( 'content_type', $_POST ) && is_string( $_POST['content_type'] ) ) {
|
2813 |
-
$content_type = $_POST['content_type'];
|
2814 |
}
|
2815 |
if ( 'preset_section' === $content_type ) {
|
2816 |
if ( !array_key_exists( 'collection_of_preset_section_id', $_POST ) || !is_array( $_POST['collection_of_preset_section_id'] ) ) {
|
@@ -2825,13 +2825,13 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2825 |
// module content type case.
|
2826 |
// the level id has been passed the regular way
|
2827 |
} else {
|
2828 |
-
$level_id = $_POST[ 'id' ];
|
2829 |
}
|
2830 |
|
2831 |
if ( array_key_exists( 'is_nested', $_POST ) && true === json_decode( $_POST['is_nested'] ) ) {
|
2832 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2833 |
-
$this->parent_model = sek_get_level_model( $_POST[ 'in_sektion' ], $sektion_collection );
|
2834 |
-
$level_model = sek_get_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2835 |
} else {
|
2836 |
//$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2837 |
$level_model = sek_get_level_model( $level_id, $sektion_collection );
|
@@ -2845,8 +2845,8 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2845 |
break;
|
2846 |
} else {
|
2847 |
// we need to set the parent_model here to access it later in the ::render method to calculate the column width.
|
2848 |
-
$this->parent_model = sek_get_parent_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2849 |
-
$level_model = sek_get_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2850 |
}
|
2851 |
break;
|
2852 |
|
@@ -2860,7 +2860,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2860 |
break;
|
2861 |
}
|
2862 |
// sek_error_log('sektion_collection', $sektion_collection );
|
2863 |
-
$level_model = sek_get_level_model( $_POST[ 'in_sektion' ], $sektion_collection );
|
2864 |
break;
|
2865 |
|
2866 |
// We re-render the entire parent column collection
|
@@ -2873,11 +2873,11 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2873 |
break;
|
2874 |
}
|
2875 |
if ( !array_key_exists( 'in_sektion', $_POST ) || empty( $_POST[ 'in_sektion' ] ) ) {
|
2876 |
-
$this->parent_model = sek_get_parent_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2877 |
} else {
|
2878 |
-
$this->parent_model = sek_get_level_model( $_POST[ 'in_sektion' ], $sektion_collection );
|
2879 |
}
|
2880 |
-
$level_model = sek_get_level_model( $_POST[ 'in_column' ], $sektion_collection );
|
2881 |
break;
|
2882 |
|
2883 |
case 'sek-resize-columns' :
|
@@ -2897,11 +2897,11 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2897 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' ' . $sek_action .' => missing level id' );
|
2898 |
break;
|
2899 |
}
|
2900 |
-
if ( !empty( $_POST['level'] ) && 'column' === $_POST['level'] ) {
|
2901 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2902 |
-
$this->parent_model = sek_get_parent_level_model( $_POST['id'], $sektion_collection );
|
2903 |
}
|
2904 |
-
$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2905 |
break;
|
2906 |
}//Switch sek_action
|
2907 |
|
@@ -2910,7 +2910,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2910 |
ob_start();
|
2911 |
|
2912 |
if ( $is_stylesheet ) {
|
2913 |
-
$r = $this->print_or_enqueue_seks_style( $_POST['location_skope_id'] );
|
2914 |
} else {
|
2915 |
if ( 'no_match' == $level_model ) {
|
2916 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' ' . $sek_action . ' => missing level model' );
|
@@ -2952,7 +2952,7 @@ if ( !class_exists( 'SEK_Front_Ajax' ) ) :
|
|
2952 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing post_id' );
|
2953 |
}
|
2954 |
|
2955 |
-
$post_id = $_POST['nimble_edit_post_id'];
|
2956 |
|
2957 |
// Build customize_url
|
2958 |
// @see function sek_get_customize_url_when_is_admin()
|
@@ -3330,7 +3330,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3330 |
nb_.preloadOrDeferAsset( {
|
3331 |
id : 'nb-main-js',
|
3332 |
as : 'script',
|
3333 |
-
href : "<?php echo $script_url; ?>",
|
3334 |
scriptEl : document.getElementById('<?php echo "nb-load-main-script"; ?>')
|
3335 |
});
|
3336 |
});
|
@@ -3343,12 +3343,12 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3343 |
foreach ($partial_front_scripts as $name => $event) {
|
3344 |
$url = sprintf('%1$s/assets/front/js/partials/%2$s.%3$s?v=%4$s', NIMBLE_BASE_URL, $name, sek_is_dev_mode() ? 'js' : 'min.js', NIMBLE_ASSETS_VERSION);
|
3345 |
?>
|
3346 |
-
<script id='<?php echo "nb-load-script-{$name}"; ?>'>
|
3347 |
nb_.listenTo('<?php echo $event; ?>', function() {
|
3348 |
nb_.preloadOrDeferAsset( {
|
3349 |
id : "<?php echo $name; ?>",
|
3350 |
as : 'script',
|
3351 |
-
href : "<?php echo $url; ?>",
|
3352 |
scriptEl : document.getElementById('<?php echo "nb-load-script-{$name}"; ?>')
|
3353 |
});
|
3354 |
});
|
@@ -3394,7 +3394,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3394 |
$assets_urls[$k] = NIMBLE_BASE_URL .$path .'?'.NIMBLE_ASSETS_VERSION;
|
3395 |
}
|
3396 |
?>
|
3397 |
-
<script id="nb-load-front-script-and-styles">nb_.listenTo("nb-needs-magnific-popup",function(){nb_.preloadOrDeferAsset({id:"nb-magnific-popup",as:"script",href:"<?php echo $assets_urls['nb-magnific-popup']; ?>",onEvent:"nb-docready"}),nb_.preloadOrDeferAsset({id:"nb-magnific-popup-style",as:"style",href:"<?php echo $assets_urls['nb-magnific-popup-style']; ?>",onEvent:"nb-docready"})}),nb_.listenTo("nb-needs-swiper",function(){nb_.preloadOrDeferAsset({id:"nb-swiper",as:"script",href:"<?php echo $assets_urls['nb-swiper']; ?>",onEvent:"nb-docready"})}),nb_.listenTo("nb-needs-videobg-js",function(){nb_.preloadOrDeferAsset({id:"nb-video-bg-plugin",as:"script",href:"<?php echo $assets_urls['nb-video-bg-plugin']; ?>",onEvent:"nb-docready"})});</script>
|
3398 |
<?php
|
3399 |
|
3400 |
/* ------------------------------------------------------------------------- *
|
@@ -3412,7 +3412,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3412 |
nb_.preloadOrDeferAsset( {
|
3413 |
id : 'nb-font-awesome',
|
3414 |
as : 'style',
|
3415 |
-
href : "<?php echo $fa_style_url; ?>",
|
3416 |
onEvent : 'nb-docready',
|
3417 |
scriptEl : document.currentScript
|
3418 |
});
|
@@ -3445,12 +3445,12 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3445 |
?>
|
3446 |
<?php foreach( $fonts as $id => $name ) : ?>
|
3447 |
<?php $font_url = NIMBLE_BASE_URL .'/assets/front/fonts/webfonts/'.$name; ?>
|
3448 |
-
<script id='<?php echo "nb-load-{$id}"; ?>'>
|
3449 |
nb_.listenTo('nb-needs-fa', function() {
|
3450 |
nb_.preloadOrDeferAsset( {
|
3451 |
id : "<?php echo $id; ?>",
|
3452 |
as : 'font',
|
3453 |
-
href : "<?php echo $font_url; ?>",
|
3454 |
type : 'font/woff2',
|
3455 |
//onEvent : 'nb-docready',
|
3456 |
//eventOnLoad : 'nb-font-awesome-preloaded',
|
@@ -3606,7 +3606,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3606 |
if ( isset($wp_scripts->registered['jquery-migrate']) )
|
3607 |
return;
|
3608 |
?>
|
3609 |
-
<script id="nb-load-jquery-migrate">!function(){var e=function(){var e=document.createElement("script");e.setAttribute("src","<?php echo NIMBLE_JQUERY_MIGRATE_URL; ?>"),e.setAttribute("id","nb-query-migrate"),e.setAttribute("defer","defer"),document.getElementsByTagName("head")[0].appendChild(e);var t=document.getElementById("nb-load-jquery-migrate");t.parentNode.removeChild(t)};nb_.listenTo("nb-jquery-loaded",function(){if(nb_.hasPreloadSupport()){var t=document.createElement("link");t.setAttribute("href","<?php echo NIMBLE_JQUERY_MIGRATE_URL; ?>"),t.setAttribute("rel","preload"),t.setAttribute("id","nb-query-migrate"),t.setAttribute("as","script"),t.onload=function(){this.onload=null,this.rel="script",e()},document.getElementsByTagName("head")[0].appendChild(t)}else e()})}();</script>
|
3610 |
<?php
|
3611 |
}
|
3612 |
|
@@ -3651,7 +3651,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
|
|
3651 |
nb_.preloadOrDeferAsset( {
|
3652 |
id : '<?php echo NIMBLE_JQUERY_ID; ?>',
|
3653 |
as : 'script',
|
3654 |
-
href : '<?php echo NIMBLE_JQUERY_LATEST_CDN_URL; ?>',
|
3655 |
scriptEl : document.currentScript
|
3656 |
});
|
3657 |
}, 0 );
|
@@ -3878,7 +3878,7 @@ if ( !class_exists( 'SEK_Front_Assets_Customizer_Preview' ) ) :
|
|
3878 |
<script type="text/html" id="sek-dyn-ui-tmpl-section">
|
3879 |
<?php //<# console.log( 'data', data ); #> ?>
|
3880 |
<div class="sek-dyn-ui-wrapper sek-section-dyn-ui">
|
3881 |
-
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
3882 |
<div class="sek-dyn-ui-icons">
|
3883 |
|
3884 |
<?php if ( sek_is_dev_mode() ) : ?>
|
@@ -3944,7 +3944,7 @@ if ( !class_exists( 'SEK_Front_Assets_Customizer_Preview' ) ) :
|
|
3944 |
?>
|
3945 |
<# var has_nested_section_class = true === data.has_nested_section ? 'sek-col-has-nested-section' : ''; #>
|
3946 |
<div class="sek-dyn-ui-wrapper sek-column-dyn-ui {{has_nested_section_class}}">
|
3947 |
-
<div class="sek-dyn-ui-inner <?php echo $icon_right_side_class; ?>">
|
3948 |
<div class="sek-dyn-ui-icons">
|
3949 |
<i class="fas fa-arrows-alt sek-move-column" title="<?php _e( 'Move column', 'nimble-builder' ); ?>"></i>
|
3950 |
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( 'Edit column settings', 'nimble-builder' ); ?>">tune</i>
|
@@ -3976,7 +3976,7 @@ if ( !class_exists( 'SEK_Front_Assets_Customizer_Preview' ) ) :
|
|
3976 |
|
3977 |
<script type="text/html" id="sek-dyn-ui-tmpl-module">
|
3978 |
<div class="sek-dyn-ui-wrapper sek-module-dyn-ui">
|
3979 |
-
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
3980 |
<div class="sek-dyn-ui-icons">
|
3981 |
<i class="fas fa-arrows-alt sek-move-module" title="<?php _e( 'Move module', 'nimble-builder' ); ?>"></i>
|
3982 |
<i data-sek-click-on="edit-module" class="fas fa-pencil-alt sek-tip sek-click-on" title="<?php _e( 'Edit module content', 'nimble-builder' ); ?>"></i>
|
@@ -4286,7 +4286,7 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
|
|
4286 |
$cached_candidate = ob_get_clean();
|
4287 |
wp_cache_add( $cache_key, $cached_candidate, $cache_group );
|
4288 |
}
|
4289 |
-
echo $cached_candidate;
|
4290 |
} else {
|
4291 |
$this->render( $locationSettingValue, $location_id );
|
4292 |
}
|
@@ -4592,7 +4592,7 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
|
|
4592 |
}
|
4593 |
?>
|
4594 |
|
4595 |
-
<div class="<?php echo $column_container_class; ?>">
|
4596 |
<div class="sek-row sek-sektion-inner">
|
4597 |
<?php
|
4598 |
// Set the parent model now
|
@@ -4694,7 +4694,7 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
|
|
4694 |
?>
|
4695 |
<div class="sek-no-modules-column">
|
4696 |
<div class="sek-module-drop-zone-for-first-module sek-content-module-drop-zone sek-drop-zone">
|
4697 |
-
<i data-sek-click-on="pick-content" data-sek-content-type="<?php echo $content_type; ?>" class="material-icons sek-click-on" title="<?php echo $title; ?>">add_circle_outline</i>
|
4698 |
<span class="sek-injection-instructions"><?php _e('Drag and drop or double-click the content that you want to insert here.', 'nimble-builder'); ?></span>
|
4699 |
</div>
|
4700 |
</div>
|
@@ -5556,7 +5556,7 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
|
|
5556 |
if ( empty( $_POST['preview-level-guid'] ) ) {
|
5557 |
sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' => error, preview-level-guid can not be empty' );
|
5558 |
}
|
5559 |
-
$this->preview_level_guid = $_POST['preview-level-guid'];
|
5560 |
} else {
|
5561 |
$this->preview_level_guid = sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) );
|
5562 |
}
|
@@ -5760,7 +5760,7 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
|
|
5760 |
sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' => error missing local_skope_id');
|
5761 |
return;
|
5762 |
}
|
5763 |
-
$local_skope_id = $_POST['local_skope_id'];
|
5764 |
|
5765 |
// Feb 2021 => for site template #478
|
5766 |
$local_skope_id = apply_filters( 'nb_set_skope_id_before_generating_local_front_css', $local_skope_id );
|
@@ -5881,7 +5881,7 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
|
|
5881 |
|
5882 |
if ( !empty( $print_candidates ) ) {
|
5883 |
?>
|
5884 |
-
<script id="nimble-preload-gfonts">nb_.preloadOrDeferAsset( { id : '<?php echo NIMBLE_GOOGLE_FONTS_STYLESHEET_ID; ?>', as : 'style', href : '//fonts.googleapis.com/css?family=<?php echo $print_candidates; ?>&display=swap', scriptEl : document.currentScript } );</script>
|
5885 |
<?php
|
5886 |
}
|
5887 |
}
|
@@ -6044,13 +6044,13 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6044 |
// get the module options
|
6045 |
// we are before 'wp', so let's use the posted skope_id and level_id to get our $module_user_values
|
6046 |
$module_model = array();
|
6047 |
-
if ( isset( $_POST['nimble_skope_id'] ) && '_skope_not_set_' !== $_POST['nimble_skope_id'] ) {
|
6048 |
$local_sektions = sek_get_skoped_seks( $_POST['nimble_skope_id'] );
|
6049 |
if ( is_array( $local_sektions ) && !empty( $local_sektions ) ) {
|
6050 |
$sektion_collection = array_key_exists('collection', $local_sektions) ? $local_sektions['collection'] : array();
|
6051 |
}
|
6052 |
if ( is_array($sektion_collection) && !empty( $sektion_collection ) && isset( $_POST['nimble_level_id'] ) ) {
|
6053 |
-
$module_model = sek_get_level_model($_POST['nimble_level_id'], $sektion_collection );
|
6054 |
$module_model = sek_normalize_module_value_with_defaults( $module_model );
|
6055 |
}
|
6056 |
} else {
|
@@ -6067,7 +6067,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6067 |
foreach ( $this->form_composition as $name => $field ) {
|
6068 |
$form_composition[ $name ] = $field;
|
6069 |
if ( isset( $_POST[ $name ] ) ) {
|
6070 |
-
$form_composition[ $name ][ 'value' ] = $_POST[ $name ];
|
6071 |
}
|
6072 |
}
|
6073 |
//set the form composition according to the user's options
|
@@ -6188,7 +6188,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6188 |
// In this case, don't echo the form, but only the user defined message which should be displayed after submitting the form
|
6189 |
if ( !is_null( $this->mailer ) ) {
|
6190 |
// Make sure we target the right form if several forms are displayed in a page
|
6191 |
-
$current_form_has_been_submitted = isset( $_POST['nimble_level_id'] ) && $_POST['nimble_level_id'] === $module_id;
|
6192 |
|
6193 |
if ( 'sent' == $this->mailer->get_status() && $current_form_has_been_submitted ) {
|
6194 |
$echo_form = false;
|
@@ -6200,7 +6200,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6200 |
<script type="text/javascript">
|
6201 |
nb_.listenTo( 'nb-jquery-loaded', function() {
|
6202 |
jQuery( function($) {
|
6203 |
-
var $elToFocusOn = $('div[data-sek-id="<?php echo $module_id; ?>"]' );
|
6204 |
if ( $elToFocusOn.length > 0 ) {
|
6205 |
var _do = function() {
|
6206 |
$('html, body').animate({
|
@@ -6232,7 +6232,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6232 |
}
|
6233 |
} else {
|
6234 |
// If we're in the regular case ( not after submission ), echo the form
|
6235 |
-
echo $form;
|
6236 |
}
|
6237 |
?>
|
6238 |
</div>
|
@@ -6319,7 +6319,7 @@ class Sek_Simple_Form extends SEK_Front_Render_Css {
|
|
6319 |
// of course we don't need to set this input value when customizing.
|
6320 |
$skope_id = '';
|
6321 |
if ( !skp_is_customizing() ) {
|
6322 |
-
$skope_id = isset( $_POST['nimble_skope_id'] ) ? $_POST['nimble_skope_id'] : sek_get_level_skope_id( $module_model['id'] );
|
6323 |
}
|
6324 |
|
6325 |
// always use the posted skope_id
|
@@ -6893,7 +6893,7 @@ class Sek_Mailer {
|
|
6893 |
// @see print_recaptcha_inline_js
|
6894 |
// on submission, we get the posted token value, and validate it with a remote http request to the google api
|
6895 |
if ( isset( $_POST['nimble_recaptcha_resp'] ) ) {
|
6896 |
-
if ( !$this->validate_recaptcha( $_POST['nimble_recaptcha_resp'] ) ) {
|
6897 |
$this->status = 'recaptcha_fail';
|
6898 |
if ( sek_is_dev_mode() ) {
|
6899 |
sek_error_log('reCAPTCHA failure', $this->recaptcha_errors );
|
52 |
// June 2020 : this property is set when saving the customizer
|
53 |
// and used to determine if we need to generate css for a given location
|
54 |
// typically useful when a local header is populated with sections but not used on the page. While still present in the collection of location, we don't want to generate css for it.
|
55 |
+
$this->customizer_active_locations = ( isset($_POST['active_locations']) && is_array($_POST['active_locations']) ) ? sanitize_text_field($_POST['active_locations']) : '_not_set_';
|
56 |
|
57 |
$this->is_global_stylesheet = $is_global_stylesheet;
|
58 |
// set the css rules for columns
|
2659 |
if ( !isset( $_POST['sek_action'] ) || empty( $_POST['sek_action'] ) ) {
|
2660 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing sek_action' );
|
2661 |
}
|
2662 |
+
$sek_action = sanitize_text_field($_POST['sek_action']);
|
2663 |
|
2664 |
$exported_setting_validities = array();
|
2665 |
|
2687 |
if ( in_array( $sek_action, $this->ajax_action_map ) ) {
|
2688 |
$content_type = null;
|
2689 |
if ( array_key_exists( 'content_type', $_POST ) && is_string( $_POST['content_type'] ) ) {
|
2690 |
+
$content_type = sanitize_text_field($_POST['content_type']);
|
2691 |
}
|
2692 |
|
2693 |
// This 'preset_section' === $content_type statement has been introduced when implementing support for multi-section pre-build sections
|
2695 |
if ( 'preset_section' === $content_type ) {
|
2696 |
$collection_of_preset_section_id = null;
|
2697 |
if ( array_key_exists( 'collection_of_preset_section_id', $_POST ) && is_array( $_POST['collection_of_preset_section_id'] ) ) {
|
2698 |
+
$collection_of_preset_section_id = array_map( 'esc_attr', $_POST['collection_of_preset_section_id'] );
|
2699 |
}
|
2700 |
|
2701 |
switch ( $sek_action ) {
|
2769 |
// c) then when ajaxing, the $_POST['customized'] param is added by WP core with $.ajaxPrefilter() in customize-preview.js
|
2770 |
//
|
2771 |
// 2) since 'wp' hook has not been fired yet, we need to use the posted skope_id param.
|
2772 |
+
$sektionSettingValue = sek_get_skoped_seks( sanitize_text_field($_POST['location_skope_id']) );
|
2773 |
if ( !is_array( $sektionSettingValue ) ) {
|
2774 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => invalid sektionSettingValue => it should be an array().' );
|
2775 |
return;
|
2795 |
case 'sek-duplicate-section' :
|
2796 |
if ( array_key_exists( 'is_nested', $_POST ) && true === json_decode( $_POST['is_nested'] ) ) {
|
2797 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2798 |
+
$this->parent_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_sektion' ]), $sektion_collection );
|
2799 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2800 |
} else {
|
2801 |
//$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2802 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'id' ]), $sektion_collection );
|
2803 |
}
|
2804 |
break;
|
2805 |
|
2810 |
case 'sek-add-content-in-new-nested-sektion' :
|
2811 |
$content_type = null;
|
2812 |
if ( array_key_exists( 'content_type', $_POST ) && is_string( $_POST['content_type'] ) ) {
|
2813 |
+
$content_type = sanitize_text_field($_POST['content_type']);
|
2814 |
}
|
2815 |
if ( 'preset_section' === $content_type ) {
|
2816 |
if ( !array_key_exists( 'collection_of_preset_section_id', $_POST ) || !is_array( $_POST['collection_of_preset_section_id'] ) ) {
|
2825 |
// module content type case.
|
2826 |
// the level id has been passed the regular way
|
2827 |
} else {
|
2828 |
+
$level_id = sanitize_text_field($_POST[ 'id' ]);
|
2829 |
}
|
2830 |
|
2831 |
if ( array_key_exists( 'is_nested', $_POST ) && true === json_decode( $_POST['is_nested'] ) ) {
|
2832 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2833 |
+
$this->parent_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_sektion' ]), $sektion_collection );
|
2834 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2835 |
} else {
|
2836 |
//$level_model = sek_get_level_model( $_POST[ 'id' ], $sektion_collection );
|
2837 |
$level_model = sek_get_level_model( $level_id, $sektion_collection );
|
2845 |
break;
|
2846 |
} else {
|
2847 |
// we need to set the parent_model here to access it later in the ::render method to calculate the column width.
|
2848 |
+
$this->parent_model = sek_get_parent_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2849 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2850 |
}
|
2851 |
break;
|
2852 |
|
2860 |
break;
|
2861 |
}
|
2862 |
// sek_error_log('sektion_collection', $sektion_collection );
|
2863 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_sektion' ]), $sektion_collection );
|
2864 |
break;
|
2865 |
|
2866 |
// We re-render the entire parent column collection
|
2873 |
break;
|
2874 |
}
|
2875 |
if ( !array_key_exists( 'in_sektion', $_POST ) || empty( $_POST[ 'in_sektion' ] ) ) {
|
2876 |
+
$this->parent_model = sek_get_parent_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2877 |
} else {
|
2878 |
+
$this->parent_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_sektion' ]), $sektion_collection );
|
2879 |
}
|
2880 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'in_column' ]), $sektion_collection );
|
2881 |
break;
|
2882 |
|
2883 |
case 'sek-resize-columns' :
|
2897 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' ' . $sek_action .' => missing level id' );
|
2898 |
break;
|
2899 |
}
|
2900 |
+
if ( !empty( $_POST['level'] ) && 'column' === sanitize_text_field($_POST['level']) ) {
|
2901 |
// we need to set the parent_mode here to access it later in the ::render method to calculate the column width.
|
2902 |
+
$this->parent_model = sek_get_parent_level_model( sanitize_text_field($_POST['id']), $sektion_collection );
|
2903 |
}
|
2904 |
+
$level_model = sek_get_level_model( sanitize_text_field($_POST[ 'id' ]), $sektion_collection );
|
2905 |
break;
|
2906 |
}//Switch sek_action
|
2907 |
|
2910 |
ob_start();
|
2911 |
|
2912 |
if ( $is_stylesheet ) {
|
2913 |
+
$r = $this->print_or_enqueue_seks_style( sanitize_text_field($_POST['location_skope_id']) );
|
2914 |
} else {
|
2915 |
if ( 'no_match' == $level_model ) {
|
2916 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' ' . $sek_action . ' => missing level model' );
|
2952 |
wp_send_json_error( __CLASS__ . '::' . __FUNCTION__ . ' => missing post_id' );
|
2953 |
}
|
2954 |
|
2955 |
+
$post_id = sanitize_text_field($_POST['nimble_edit_post_id']);
|
2956 |
|
2957 |
// Build customize_url
|
2958 |
// @see function sek_get_customize_url_when_is_admin()
|
3330 |
nb_.preloadOrDeferAsset( {
|
3331 |
id : 'nb-main-js',
|
3332 |
as : 'script',
|
3333 |
+
href : "<?php echo esc_url($script_url); ?>",
|
3334 |
scriptEl : document.getElementById('<?php echo "nb-load-main-script"; ?>')
|
3335 |
});
|
3336 |
});
|
3343 |
foreach ($partial_front_scripts as $name => $event) {
|
3344 |
$url = sprintf('%1$s/assets/front/js/partials/%2$s.%3$s?v=%4$s', NIMBLE_BASE_URL, $name, sek_is_dev_mode() ? 'js' : 'min.js', NIMBLE_ASSETS_VERSION);
|
3345 |
?>
|
3346 |
+
<script id='<?php echo esc_attr("nb-load-script-{$name}"); ?>'>
|
3347 |
nb_.listenTo('<?php echo $event; ?>', function() {
|
3348 |
nb_.preloadOrDeferAsset( {
|
3349 |
id : "<?php echo $name; ?>",
|
3350 |
as : 'script',
|
3351 |
+
href : "<?php echo esc_url($url); ?>",
|
3352 |
scriptEl : document.getElementById('<?php echo "nb-load-script-{$name}"; ?>')
|
3353 |
});
|
3354 |
});
|
3394 |
$assets_urls[$k] = NIMBLE_BASE_URL .$path .'?'.NIMBLE_ASSETS_VERSION;
|
3395 |
}
|
3396 |
?>
|
3397 |
+
<script id="nb-load-front-script-and-styles">nb_.listenTo("nb-needs-magnific-popup",function(){nb_.preloadOrDeferAsset({id:"nb-magnific-popup",as:"script",href:"<?php echo esc_attr($assets_urls['nb-magnific-popup']); ?>",onEvent:"nb-docready"}),nb_.preloadOrDeferAsset({id:"nb-magnific-popup-style",as:"style",href:"<?php echo esc_attr($assets_urls['nb-magnific-popup-style']); ?>",onEvent:"nb-docready"})}),nb_.listenTo("nb-needs-swiper",function(){nb_.preloadOrDeferAsset({id:"nb-swiper",as:"script",href:"<?php echo esc_attr($assets_urls['nb-swiper']); ?>",onEvent:"nb-docready"})}),nb_.listenTo("nb-needs-videobg-js",function(){nb_.preloadOrDeferAsset({id:"nb-video-bg-plugin",as:"script",href:"<?php echo esc_attr($assets_urls['nb-video-bg-plugin']); ?>",onEvent:"nb-docready"})});</script>
|
3398 |
<?php
|
3399 |
|
3400 |
/* ------------------------------------------------------------------------- *
|
3412 |
nb_.preloadOrDeferAsset( {
|
3413 |
id : 'nb-font-awesome',
|
3414 |
as : 'style',
|
3415 |
+
href : "<?php echo esc_url($fa_style_url); ?>",
|
3416 |
onEvent : 'nb-docready',
|
3417 |
scriptEl : document.currentScript
|
3418 |
});
|
3445 |
?>
|
3446 |
<?php foreach( $fonts as $id => $name ) : ?>
|
3447 |
<?php $font_url = NIMBLE_BASE_URL .'/assets/front/fonts/webfonts/'.$name; ?>
|
3448 |
+
<script id='<?php echo esc_attr("nb-load-{$id}"); ?>'>
|
3449 |
nb_.listenTo('nb-needs-fa', function() {
|
3450 |
nb_.preloadOrDeferAsset( {
|
3451 |
id : "<?php echo $id; ?>",
|
3452 |
as : 'font',
|
3453 |
+
href : "<?php echo esc_url($font_url); ?>",
|
3454 |
type : 'font/woff2',
|
3455 |
//onEvent : 'nb-docready',
|
3456 |
//eventOnLoad : 'nb-font-awesome-preloaded',
|
3606 |
if ( isset($wp_scripts->registered['jquery-migrate']) )
|
3607 |
return;
|
3608 |
?>
|
3609 |
+
<script id="nb-load-jquery-migrate">!function(){var e=function(){var e=document.createElement("script");e.setAttribute("src","<?php echo esc_url(NIMBLE_JQUERY_MIGRATE_URL); ?>"),e.setAttribute("id","nb-query-migrate"),e.setAttribute("defer","defer"),document.getElementsByTagName("head")[0].appendChild(e);var t=document.getElementById("nb-load-jquery-migrate");t.parentNode.removeChild(t)};nb_.listenTo("nb-jquery-loaded",function(){if(nb_.hasPreloadSupport()){var t=document.createElement("link");t.setAttribute("href","<?php echo esc_url(NIMBLE_JQUERY_MIGRATE_URL); ?>"),t.setAttribute("rel","preload"),t.setAttribute("id","nb-query-migrate"),t.setAttribute("as","script"),t.onload=function(){this.onload=null,this.rel="script",e()},document.getElementsByTagName("head")[0].appendChild(t)}else e()})}();</script>
|
3610 |
<?php
|
3611 |
}
|
3612 |
|
3651 |
nb_.preloadOrDeferAsset( {
|
3652 |
id : '<?php echo NIMBLE_JQUERY_ID; ?>',
|
3653 |
as : 'script',
|
3654 |
+
href : '<?php echo esc_url(NIMBLE_JQUERY_LATEST_CDN_URL); ?>',
|
3655 |
scriptEl : document.currentScript
|
3656 |
});
|
3657 |
}, 0 );
|
3878 |
<script type="text/html" id="sek-dyn-ui-tmpl-section">
|
3879 |
<?php //<# console.log( 'data', data ); #> ?>
|
3880 |
<div class="sek-dyn-ui-wrapper sek-section-dyn-ui">
|
3881 |
+
<div class="sek-dyn-ui-inner <?php echo esc_attr($icon_left_side_class); ?>">
|
3882 |
<div class="sek-dyn-ui-icons">
|
3883 |
|
3884 |
<?php if ( sek_is_dev_mode() ) : ?>
|
3944 |
?>
|
3945 |
<# var has_nested_section_class = true === data.has_nested_section ? 'sek-col-has-nested-section' : ''; #>
|
3946 |
<div class="sek-dyn-ui-wrapper sek-column-dyn-ui {{has_nested_section_class}}">
|
3947 |
+
<div class="sek-dyn-ui-inner <?php echo esc_attr($icon_right_side_class); ?>">
|
3948 |
<div class="sek-dyn-ui-icons">
|
3949 |
<i class="fas fa-arrows-alt sek-move-column" title="<?php _e( 'Move column', 'nimble-builder' ); ?>"></i>
|
3950 |
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( 'Edit column settings', 'nimble-builder' ); ?>">tune</i>
|
3976 |
|
3977 |
<script type="text/html" id="sek-dyn-ui-tmpl-module">
|
3978 |
<div class="sek-dyn-ui-wrapper sek-module-dyn-ui">
|
3979 |
+
<div class="sek-dyn-ui-inner <?php echo esc_attr($icon_left_side_class); ?>">
|
3980 |
<div class="sek-dyn-ui-icons">
|
3981 |
<i class="fas fa-arrows-alt sek-move-module" title="<?php _e( 'Move module', 'nimble-builder' ); ?>"></i>
|
3982 |
<i data-sek-click-on="edit-module" class="fas fa-pencil-alt sek-tip sek-click-on" title="<?php _e( 'Edit module content', 'nimble-builder' ); ?>"></i>
|
4286 |
$cached_candidate = ob_get_clean();
|
4287 |
wp_cache_add( $cache_key, $cached_candidate, $cache_group );
|
4288 |
}
|
4289 |
+
echo esc_html($cached_candidate);
|
4290 |
} else {
|
4291 |
$this->render( $locationSettingValue, $location_id );
|
4292 |
}
|
4592 |
}
|
4593 |
?>
|
4594 |
|
4595 |
+
<div class="<?php echo esc_attr($column_container_class); ?>">
|
4596 |
<div class="sek-row sek-sektion-inner">
|
4597 |
<?php
|
4598 |
// Set the parent model now
|
4694 |
?>
|
4695 |
<div class="sek-no-modules-column">
|
4696 |
<div class="sek-module-drop-zone-for-first-module sek-content-module-drop-zone sek-drop-zone">
|
4697 |
+
<i data-sek-click-on="pick-content" data-sek-content-type="<?php echo esc_attr($content_type); ?>" class="material-icons sek-click-on" title="<?php echo esc_attr($title); ?>">add_circle_outline</i>
|
4698 |
<span class="sek-injection-instructions"><?php _e('Drag and drop or double-click the content that you want to insert here.', 'nimble-builder'); ?></span>
|
4699 |
</div>
|
4700 |
</div>
|
5556 |
if ( empty( $_POST['preview-level-guid'] ) ) {
|
5557 |
sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' => error, preview-level-guid can not be empty' );
|
5558 |
}
|
5559 |
+
$this->preview_level_guid = sanitize_text_field($_POST['preview-level-guid']);
|
5560 |
} else {
|
5561 |
$this->preview_level_guid = sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) );
|
5562 |
}
|
5760 |
sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' => error missing local_skope_id');
|
5761 |
return;
|
5762 |
}
|
5763 |
+
$local_skope_id = sanitize_text_field($_POST['local_skope_id']);
|
5764 |
|
5765 |
// Feb 2021 => for site template #478
|
5766 |
$local_skope_id = apply_filters( 'nb_set_skope_id_before_generating_local_front_css', $local_skope_id );
|
5881 |
|
5882 |
if ( !empty( $print_candidates ) ) {
|
5883 |
?>
|
5884 |
+
<script id="nimble-preload-gfonts">nb_.preloadOrDeferAsset( { id : '<?php echo NIMBLE_GOOGLE_FONTS_STYLESHEET_ID; ?>', as : 'style', href : '//fonts.googleapis.com/css?family=<?php echo esc_attr($print_candidates); ?>&display=swap', scriptEl : document.currentScript } );</script>
|
5885 |
<?php
|
5886 |
}
|
5887 |
}
|
6044 |
// get the module options
|
6045 |
// we are before 'wp', so let's use the posted skope_id and level_id to get our $module_user_values
|
6046 |
$module_model = array();
|
6047 |
+
if ( isset( $_POST['nimble_skope_id'] ) && '_skope_not_set_' !== sanitize_text_field($_POST['nimble_skope_id']) ) {
|
6048 |
$local_sektions = sek_get_skoped_seks( $_POST['nimble_skope_id'] );
|
6049 |
if ( is_array( $local_sektions ) && !empty( $local_sektions ) ) {
|
6050 |
$sektion_collection = array_key_exists('collection', $local_sektions) ? $local_sektions['collection'] : array();
|
6051 |
}
|
6052 |
if ( is_array($sektion_collection) && !empty( $sektion_collection ) && isset( $_POST['nimble_level_id'] ) ) {
|
6053 |
+
$module_model = sek_get_level_model(sanitize_text_field($_POST['nimble_level_id']), $sektion_collection );
|
6054 |
$module_model = sek_normalize_module_value_with_defaults( $module_model );
|
6055 |
}
|
6056 |
} else {
|
6067 |
foreach ( $this->form_composition as $name => $field ) {
|
6068 |
$form_composition[ $name ] = $field;
|
6069 |
if ( isset( $_POST[ $name ] ) ) {
|
6070 |
+
$form_composition[ $name ][ 'value' ] = sanitize_text_field($_POST[ $name ]);
|
6071 |
}
|
6072 |
}
|
6073 |
//set the form composition according to the user's options
|
6188 |
// In this case, don't echo the form, but only the user defined message which should be displayed after submitting the form
|
6189 |
if ( !is_null( $this->mailer ) ) {
|
6190 |
// Make sure we target the right form if several forms are displayed in a page
|
6191 |
+
$current_form_has_been_submitted = isset( $_POST['nimble_level_id'] ) && sanitize_text_field($_POST['nimble_level_id']) === $module_id;
|
6192 |
|
6193 |
if ( 'sent' == $this->mailer->get_status() && $current_form_has_been_submitted ) {
|
6194 |
$echo_form = false;
|
6200 |
<script type="text/javascript">
|
6201 |
nb_.listenTo( 'nb-jquery-loaded', function() {
|
6202 |
jQuery( function($) {
|
6203 |
+
var $elToFocusOn = $('div[data-sek-id="<?php echo esc_attr($module_id); ?>"]' );
|
6204 |
if ( $elToFocusOn.length > 0 ) {
|
6205 |
var _do = function() {
|
6206 |
$('html, body').animate({
|
6232 |
}
|
6233 |
} else {
|
6234 |
// If we're in the regular case ( not after submission ), echo the form
|
6235 |
+
echo esc_html($form);
|
6236 |
}
|
6237 |
?>
|
6238 |
</div>
|
6319 |
// of course we don't need to set this input value when customizing.
|
6320 |
$skope_id = '';
|
6321 |
if ( !skp_is_customizing() ) {
|
6322 |
+
$skope_id = isset( $_POST['nimble_skope_id'] ) ? sanitize_text_field($_POST['nimble_skope_id']) : sek_get_level_skope_id( $module_model['id'] );
|
6323 |
}
|
6324 |
|
6325 |
// always use the posted skope_id
|
6893 |
// @see print_recaptcha_inline_js
|
6894 |
// on submission, we get the posted token value, and validate it with a remote http request to the google api
|
6895 |
if ( isset( $_POST['nimble_recaptcha_resp'] ) ) {
|
6896 |
+
if ( !$this->validate_recaptcha( sanitize_text_field($_POST['nimble_recaptcha_resp']) ) ) {
|
6897 |
$this->status = 'recaptcha_fail';
|
6898 |
if ( sek_is_dev_mode() ) {
|
6899 |
sek_error_log('reCAPTCHA failure', $this->recaptcha_errors );
|
inc/sektions/ccat-sektions-ui-modules.php
CHANGED
@@ -3530,7 +3530,7 @@ function sek_add_raw_local_widths_css( $css, $is_global_stylesheet ) {
|
|
3530 |
$css = is_string( $css ) ? $css : '';
|
3531 |
// we use the ajaxily posted skope_id when available <= typically in a customizing ajax action 'sek-refresh-stylesheet'
|
3532 |
// otherwise we fallback on the normal utility skp_build_skope_id()
|
3533 |
-
$local_options = sek_get_skoped_seks( !empty( $_POST['local_skope_id'] ) ? $_POST['local_skope_id'] : skp_build_skope_id() );
|
3534 |
|
3535 |
if ( !is_array( $local_options ) || empty( $local_options['local_options']) || empty( $local_options['local_options']['widths'] ) )
|
3536 |
return $css;
|
@@ -3654,7 +3654,7 @@ function sek_add_raw_local_custom_css( $css, $is_global_stylesheet ) {
|
|
3654 |
return $css;
|
3655 |
// we use the ajaxily posted skope_id when available <= typically in a customizing ajax action 'sek-refresh-stylesheet'
|
3656 |
// otherwise we fallback on the normal utility skp_build_skope_id()
|
3657 |
-
$local_options = sek_get_skoped_seks( !empty( $_POST['local_skope_id'] ) ? $_POST['local_skope_id'] : skp_build_skope_id() );
|
3658 |
if ( is_array( $local_options ) && !empty( $local_options['local_options']) && !empty( $local_options['local_options']['custom_css'] ) ) {
|
3659 |
$options = $local_options['local_options']['custom_css'];
|
3660 |
if ( !empty( $options['local_custom_css'] ) ) {
|
3530 |
$css = is_string( $css ) ? $css : '';
|
3531 |
// we use the ajaxily posted skope_id when available <= typically in a customizing ajax action 'sek-refresh-stylesheet'
|
3532 |
// otherwise we fallback on the normal utility skp_build_skope_id()
|
3533 |
+
$local_options = sek_get_skoped_seks( !empty( $_POST['local_skope_id'] ) ? sanitize_text_field($_POST['local_skope_id']) : skp_build_skope_id() );
|
3534 |
|
3535 |
if ( !is_array( $local_options ) || empty( $local_options['local_options']) || empty( $local_options['local_options']['widths'] ) )
|
3536 |
return $css;
|
3654 |
return $css;
|
3655 |
// we use the ajaxily posted skope_id when available <= typically in a customizing ajax action 'sek-refresh-stylesheet'
|
3656 |
// otherwise we fallback on the normal utility skp_build_skope_id()
|
3657 |
+
$local_options = sek_get_skoped_seks( !empty( $_POST['local_skope_id'] ) ? sanitize_text_field($_POST['local_skope_id']) : skp_build_skope_id() );
|
3658 |
if ( is_array( $local_options ) && !empty( $local_options['local_options']) && !empty( $local_options['local_options']['custom_css'] ) ) {
|
3659 |
$options = $local_options['local_options']['custom_css'];
|
3660 |
if ( !empty( $options['local_custom_css'] ) ) {
|
nimble-builder.php
CHANGED
@@ -1,164 +1,164 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Nimble Page Builder
|
4 |
-
* Plugin URI: https://nimblebuilder.com
|
5 |
-
* Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
6 |
-
* Version: 3.1.
|
7 |
-
* Text Domain: nimble-builder
|
8 |
-
* Author: Press Customizr
|
9 |
-
* Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
|
10 |
-
* License: GPLv3
|
11 |
-
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
-
*/
|
13 |
-
if ( !defined( 'ABSPATH' ) ) {
|
14 |
-
exit;
|
15 |
-
}
|
16 |
-
/* ------------------------------------------------------------------------- *
|
17 |
-
* CONSTANTS
|
18 |
-
/* ------------------------------------------------------------------------- */
|
19 |
-
$current_version = "3.1.
|
20 |
-
|
21 |
-
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
22 |
-
if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
|
23 |
-
if ( !defined( 'NIMBLE_BASE_URL' ) ) { define( 'NIMBLE_BASE_URL' , plugins_url( NIMBLE_DIR_NAME ) ); }
|
24 |
-
if ( !defined( 'NIMBLE_BASE_PATH' ) ) { define( 'NIMBLE_BASE_PATH' , dirname( __FILE__ ) ); }
|
25 |
-
if ( !defined( 'NIMBLE_MIN_PHP_VERSION' ) ) { define ( 'NIMBLE_MIN_PHP_VERSION', '5.4' ); }
|
26 |
-
if ( !defined( 'NIMBLE_MIN_WP_VERSION' ) ) { define ( 'NIMBLE_MIN_WP_VERSION', '4.7' ); }
|
27 |
-
if ( !defined( 'NIMBLE_PLUGIN_FILE' ) ) { define( 'NIMBLE_PLUGIN_FILE', __FILE__ ); }// Plugin Root File used register_activation_hook( NIMBLE_PLUGIN_FILE, 'nimble_install' );
|
28 |
-
|
29 |
-
if ( !defined( 'NIMBLE_BETA_FEATURES_ENABLED' ) ) { define ( 'NIMBLE_BETA_FEATURES_ENABLED', false ); }
|
30 |
-
|
31 |
-
if ( !defined( 'NIMBLE_SHOW_UPDATE_NOTICE_FOR_VERSION' ) ) { define( 'NIMBLE_SHOW_UPDATE_NOTICE_FOR_VERSION', '1.8.3' ); }
|
32 |
-
if ( !defined( 'NIMBLE_RELEASE_NOTE_URL' ) ) { define( 'NIMBLE_RELEASE_NOTE_URL', 'https://presscustomizr.com/nimble-builder-introduces-a-new-about-us-pre-built-section-and-global-text-options/' ); }
|
33 |
-
|
34 |
-
// when NIMBLE_IS_PREVIEW_UI_DEBUG_MODE or $_GET['preview_ui_debug'] is true, the levels UI in the preview are not being auto removed, so we can inspect the markup and CSS
|
35 |
-
if ( !defined( 'NIMBLE_IS_PREVIEW_UI_DEBUG_MODE' ) ) { define ( 'NIMBLE_IS_PREVIEW_UI_DEBUG_MODE', false ); }
|
36 |
-
|
37 |
-
// Admin page
|
38 |
-
if ( !defined( 'NIMBLE_OPTIONS_PAGE' ) ) { define ( 'NIMBLE_OPTIONS_PAGE', 'nb-options' ); }
|
39 |
-
if ( !defined( 'NIMBLE_OPTIONS_PAGE_URL' ) ) { define ( 'NIMBLE_OPTIONS_PAGE_URL', 'options-general.php?page=' . NIMBLE_OPTIONS_PAGE ); }
|
40 |
-
|
41 |
-
/* ------------------------------------------------------------------------- *
|
42 |
-
* CHECK PHP AND WP REQUIREMENTS
|
43 |
-
/* ------------------------------------------------------------------------- */
|
44 |
-
if ( version_compare( phpversion(), NIMBLE_MIN_PHP_VERSION, '<' ) ) {
|
45 |
-
add_action( 'admin_notices' , 'nimble_display_min_php_message' );
|
46 |
-
return;
|
47 |
-
}
|
48 |
-
global $wp_version;
|
49 |
-
if ( version_compare( $wp_version, NIMBLE_MIN_WP_VERSION, '<' ) ) {
|
50 |
-
add_action( 'admin_notices' , 'nimble_display_min_wp_message' );
|
51 |
-
return;
|
52 |
-
}
|
53 |
-
|
54 |
-
function nimble_passes_requirements(){
|
55 |
-
global $wp_version;
|
56 |
-
return !version_compare( phpversion(), NIMBLE_MIN_PHP_VERSION, '<' ) && !version_compare( $wp_version, NIMBLE_MIN_WP_VERSION, '<' );
|
57 |
-
}
|
58 |
-
|
59 |
-
function nimble_display_min_php_message() {
|
60 |
-
nimble_display_min_requirement_notice( __( 'PHP', 'nimble-builder' ), NIMBLE_MIN_PHP_VERSION );
|
61 |
-
}
|
62 |
-
function nimble_display_min_wp_message() {
|
63 |
-
nimble_display_min_requirement_notice( __( 'WordPress', 'nimble-builder' ), NIMBLE_MIN_WP_VERSION );
|
64 |
-
}
|
65 |
-
function nimble_display_min_requirement_notice( $requires_what, $requires_what_version ) {
|
66 |
-
printf( '<div class="error"><p>%1$s</p></div>',
|
67 |
-
sprintf( __( 'The <strong>%1$s</strong> plugin requires at least %2$s version %3$s.', 'nimble-builder' ),
|
68 |
-
__('Nimble Builder', 'nimble-builder'),
|
69 |
-
$requires_what,
|
70 |
-
$requires_what_version
|
71 |
-
)
|
72 |
-
);
|
73 |
-
}
|
74 |
-
|
75 |
-
/* ------------------------------------------------------------------------- *
|
76 |
-
* LOAD
|
77 |
-
/* ------------------------------------------------------------------------- */
|
78 |
-
add_action( 'after_setup_theme', 'nimble_load_czr_base_fmk', 10 );
|
79 |
-
function nimble_load_czr_base_fmk() {
|
80 |
-
if ( !nimble_passes_requirements() )
|
81 |
-
return;
|
82 |
-
if ( did_action( 'nimble_base_fmk_loaded' ) ) {
|
83 |
-
if ( ( defined( 'CZR_DEV' ) && CZR_DEV ) || ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) ) {
|
84 |
-
error_log( __FILE__ . ' => The czr_base_fmk has already been loaded');
|
85 |
-
}
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
|
89 |
-
require_once( NIMBLE_BASE_PATH . '/inc/czr-base-fmk/czr-base-fmk.php' );
|
90 |
-
if ( class_exists('\Nimble\CZR_Fmk_Base') ) {
|
91 |
-
\Nimble\CZR_Fmk_Base( array(
|
92 |
-
'base_url' => NIMBLE_BASE_URL . '/inc/czr-base-fmk',
|
93 |
-
'version' => NIMBLE_VERSION
|
94 |
-
));
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
if ( nimble_passes_requirements() ) {
|
99 |
-
require_once( NIMBLE_BASE_PATH . '/inc/czr-skope/index.php' );
|
100 |
-
add_action( 'after_setup_theme', 'nimble_load_skope_php');
|
101 |
-
function nimble_load_skope_php() {
|
102 |
-
if ( class_exists('\Nimble\Flat_Skop_Base') ) {
|
103 |
-
\Nimble\Flat_Skop_Base( array(
|
104 |
-
'base_url_path' => NIMBLE_BASE_URL . '/inc/czr-skope'
|
105 |
-
) );
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
do_action('nimble_before_loading');
|
110 |
-
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-constants-and-helper-functions.php' );
|
111 |
-
do_action('nimble_base_loaded');
|
112 |
-
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-ui-modules.php' );
|
113 |
-
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-front-modules.php' );
|
114 |
-
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-base.php' );
|
115 |
-
do_action('nimble_after_loading');
|
116 |
-
|
117 |
-
// $_POST['ac_get_template'] <= scenario of an input template getting ajaxily fetched
|
118 |
-
if ( \Nimble\skp_is_customizing() || isset( $_POST['ac_get_template']) || ( defined('DOING_AJAX') && DOING_AJAX ) ) {
|
119 |
-
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-czr-sektions.php' );
|
120 |
-
do_action('nimble_base_czr_loaded');
|
121 |
-
}
|
122 |
-
|
123 |
-
add_action( 'after_setup_theme', 'nimble_setup_dyn_register', 20 );
|
124 |
-
function nimble_setup_dyn_register( $params = array() ) {
|
125 |
-
if ( class_exists('\Nimble\SEK_CZR_Dyn_Register') ) {
|
126 |
-
// instantiate if not done yet
|
127 |
-
\Nimble\SEK_CZR_Dyn_Register::get_instance( $params );
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
if ( defined( 'NIMBLE_PRINT_DEV_LOGS' ) && NIMBLE_PRINT_DEV_LOGS && file_exists( plugin_dir_path( __FILE__ ) . 'dev_logs.php' ) ) {
|
132 |
-
require_once( NIMBLE_BASE_PATH . '/dev_logs.php' );
|
133 |
-
}
|
134 |
-
|
135 |
-
add_action('plugins_loaded', 'nimble_load_plugin_textdomain');
|
136 |
-
/**
|
137 |
-
* Load language files
|
138 |
-
* @action plugins_loaded
|
139 |
-
*/
|
140 |
-
function nimble_load_plugin_textdomain() {
|
141 |
-
// Note to self, the third argument must not be hardcoded, to account for relocated folders.
|
142 |
-
load_plugin_textdomain( 'nimble-builder' );
|
143 |
-
}
|
144 |
-
|
145 |
-
require_once( NIMBLE_BASE_PATH . '/inc/functions.php' );
|
146 |
-
|
147 |
-
// Fire the retro compatibility functions
|
148 |
-
// Note : if fired @plugins_loaded, invoking wp_update_post() generates php notices
|
149 |
-
//add_action( 'wp_loaded', '\Nimble\sek_maybe_do_version_mapping' );
|
150 |
-
// introduced for https://github.com/presscustomizr/nimble-builder/issues/799
|
151 |
-
add_action( 'wp_loaded', '\Nimble\sek_maybe_optimize_options' );
|
152 |
-
|
153 |
-
// Load admin
|
154 |
-
if ( is_admin() ) {
|
155 |
-
require_once( NIMBLE_BASE_PATH . '/inc/admin/nimble-admin.php' );
|
156 |
-
do_action('nimble_admin_loaded');
|
157 |
-
}
|
158 |
-
|
159 |
-
// Load nimblizer
|
160 |
-
if ( is_admin() && defined('NIMBLIZER_ENABLED') && NIMBLIZER_ENABLED ) {
|
161 |
-
require_once( NIMBLE_BASE_PATH . '/inc/nimblizer/nimblizer-functions.php' );
|
162 |
-
do_action('nimblizer_loaded');
|
163 |
-
}
|
164 |
}//if ( nimble_passes_requirements() )
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Nimble Page Builder
|
4 |
+
* Plugin URI: https://nimblebuilder.com
|
5 |
+
* Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
6 |
+
* Version: 3.1.33
|
7 |
+
* Text Domain: nimble-builder
|
8 |
+
* Author: Press Customizr
|
9 |
+
* Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
|
10 |
+
* License: GPLv3
|
11 |
+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
+
*/
|
13 |
+
if ( !defined( 'ABSPATH' ) ) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
/* ------------------------------------------------------------------------- *
|
17 |
+
* CONSTANTS
|
18 |
+
/* ------------------------------------------------------------------------- */
|
19 |
+
$current_version = "3.1.33";
|
20 |
+
|
21 |
+
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
22 |
+
if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
|
23 |
+
if ( !defined( 'NIMBLE_BASE_URL' ) ) { define( 'NIMBLE_BASE_URL' , plugins_url( NIMBLE_DIR_NAME ) ); }
|
24 |
+
if ( !defined( 'NIMBLE_BASE_PATH' ) ) { define( 'NIMBLE_BASE_PATH' , dirname( __FILE__ ) ); }
|
25 |
+
if ( !defined( 'NIMBLE_MIN_PHP_VERSION' ) ) { define ( 'NIMBLE_MIN_PHP_VERSION', '5.4' ); }
|
26 |
+
if ( !defined( 'NIMBLE_MIN_WP_VERSION' ) ) { define ( 'NIMBLE_MIN_WP_VERSION', '4.7' ); }
|
27 |
+
if ( !defined( 'NIMBLE_PLUGIN_FILE' ) ) { define( 'NIMBLE_PLUGIN_FILE', __FILE__ ); }// Plugin Root File used register_activation_hook( NIMBLE_PLUGIN_FILE, 'nimble_install' );
|
28 |
+
|
29 |
+
if ( !defined( 'NIMBLE_BETA_FEATURES_ENABLED' ) ) { define ( 'NIMBLE_BETA_FEATURES_ENABLED', false ); }
|
30 |
+
|
31 |
+
if ( !defined( 'NIMBLE_SHOW_UPDATE_NOTICE_FOR_VERSION' ) ) { define( 'NIMBLE_SHOW_UPDATE_NOTICE_FOR_VERSION', '1.8.3' ); }
|
32 |
+
if ( !defined( 'NIMBLE_RELEASE_NOTE_URL' ) ) { define( 'NIMBLE_RELEASE_NOTE_URL', 'https://presscustomizr.com/nimble-builder-introduces-a-new-about-us-pre-built-section-and-global-text-options/' ); }
|
33 |
+
|
34 |
+
// when NIMBLE_IS_PREVIEW_UI_DEBUG_MODE or $_GET['preview_ui_debug'] is true, the levels UI in the preview are not being auto removed, so we can inspect the markup and CSS
|
35 |
+
if ( !defined( 'NIMBLE_IS_PREVIEW_UI_DEBUG_MODE' ) ) { define ( 'NIMBLE_IS_PREVIEW_UI_DEBUG_MODE', false ); }
|
36 |
+
|
37 |
+
// Admin page
|
38 |
+
if ( !defined( 'NIMBLE_OPTIONS_PAGE' ) ) { define ( 'NIMBLE_OPTIONS_PAGE', 'nb-options' ); }
|
39 |
+
if ( !defined( 'NIMBLE_OPTIONS_PAGE_URL' ) ) { define ( 'NIMBLE_OPTIONS_PAGE_URL', 'options-general.php?page=' . NIMBLE_OPTIONS_PAGE ); }
|
40 |
+
|
41 |
+
/* ------------------------------------------------------------------------- *
|
42 |
+
* CHECK PHP AND WP REQUIREMENTS
|
43 |
+
/* ------------------------------------------------------------------------- */
|
44 |
+
if ( version_compare( phpversion(), NIMBLE_MIN_PHP_VERSION, '<' ) ) {
|
45 |
+
add_action( 'admin_notices' , 'nimble_display_min_php_message' );
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
global $wp_version;
|
49 |
+
if ( version_compare( $wp_version, NIMBLE_MIN_WP_VERSION, '<' ) ) {
|
50 |
+
add_action( 'admin_notices' , 'nimble_display_min_wp_message' );
|
51 |
+
return;
|
52 |
+
}
|
53 |
+
|
54 |
+
function nimble_passes_requirements(){
|
55 |
+
global $wp_version;
|
56 |
+
return !version_compare( phpversion(), NIMBLE_MIN_PHP_VERSION, '<' ) && !version_compare( $wp_version, NIMBLE_MIN_WP_VERSION, '<' );
|
57 |
+
}
|
58 |
+
|
59 |
+
function nimble_display_min_php_message() {
|
60 |
+
nimble_display_min_requirement_notice( __( 'PHP', 'nimble-builder' ), NIMBLE_MIN_PHP_VERSION );
|
61 |
+
}
|
62 |
+
function nimble_display_min_wp_message() {
|
63 |
+
nimble_display_min_requirement_notice( __( 'WordPress', 'nimble-builder' ), NIMBLE_MIN_WP_VERSION );
|
64 |
+
}
|
65 |
+
function nimble_display_min_requirement_notice( $requires_what, $requires_what_version ) {
|
66 |
+
printf( '<div class="error"><p>%1$s</p></div>',
|
67 |
+
sprintf( __( 'The <strong>%1$s</strong> plugin requires at least %2$s version %3$s.', 'nimble-builder' ),
|
68 |
+
__('Nimble Builder', 'nimble-builder'),
|
69 |
+
$requires_what,
|
70 |
+
$requires_what_version
|
71 |
+
)
|
72 |
+
);
|
73 |
+
}
|
74 |
+
|
75 |
+
/* ------------------------------------------------------------------------- *
|
76 |
+
* LOAD
|
77 |
+
/* ------------------------------------------------------------------------- */
|
78 |
+
add_action( 'after_setup_theme', 'nimble_load_czr_base_fmk', 10 );
|
79 |
+
function nimble_load_czr_base_fmk() {
|
80 |
+
if ( !nimble_passes_requirements() )
|
81 |
+
return;
|
82 |
+
if ( did_action( 'nimble_base_fmk_loaded' ) ) {
|
83 |
+
if ( ( defined( 'CZR_DEV' ) && CZR_DEV ) || ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) ) {
|
84 |
+
error_log( __FILE__ . ' => The czr_base_fmk has already been loaded');
|
85 |
+
}
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
|
89 |
+
require_once( NIMBLE_BASE_PATH . '/inc/czr-base-fmk/czr-base-fmk.php' );
|
90 |
+
if ( class_exists('\Nimble\CZR_Fmk_Base') ) {
|
91 |
+
\Nimble\CZR_Fmk_Base( array(
|
92 |
+
'base_url' => NIMBLE_BASE_URL . '/inc/czr-base-fmk',
|
93 |
+
'version' => NIMBLE_VERSION
|
94 |
+
));
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( nimble_passes_requirements() ) {
|
99 |
+
require_once( NIMBLE_BASE_PATH . '/inc/czr-skope/index.php' );
|
100 |
+
add_action( 'after_setup_theme', 'nimble_load_skope_php');
|
101 |
+
function nimble_load_skope_php() {
|
102 |
+
if ( class_exists('\Nimble\Flat_Skop_Base') ) {
|
103 |
+
\Nimble\Flat_Skop_Base( array(
|
104 |
+
'base_url_path' => NIMBLE_BASE_URL . '/inc/czr-skope'
|
105 |
+
) );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
do_action('nimble_before_loading');
|
110 |
+
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-constants-and-helper-functions.php' );
|
111 |
+
do_action('nimble_base_loaded');
|
112 |
+
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-ui-modules.php' );
|
113 |
+
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-front-modules.php' );
|
114 |
+
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-sektions-base.php' );
|
115 |
+
do_action('nimble_after_loading');
|
116 |
+
|
117 |
+
// $_POST['ac_get_template'] <= scenario of an input template getting ajaxily fetched
|
118 |
+
if ( \Nimble\skp_is_customizing() || isset( $_POST['ac_get_template']) || ( defined('DOING_AJAX') && DOING_AJAX ) ) {
|
119 |
+
require_once( NIMBLE_BASE_PATH . '/inc/sektions/ccat-czr-sektions.php' );
|
120 |
+
do_action('nimble_base_czr_loaded');
|
121 |
+
}
|
122 |
+
|
123 |
+
add_action( 'after_setup_theme', 'nimble_setup_dyn_register', 20 );
|
124 |
+
function nimble_setup_dyn_register( $params = array() ) {
|
125 |
+
if ( class_exists('\Nimble\SEK_CZR_Dyn_Register') ) {
|
126 |
+
// instantiate if not done yet
|
127 |
+
\Nimble\SEK_CZR_Dyn_Register::get_instance( $params );
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( defined( 'NIMBLE_PRINT_DEV_LOGS' ) && NIMBLE_PRINT_DEV_LOGS && file_exists( plugin_dir_path( __FILE__ ) . 'dev_logs.php' ) ) {
|
132 |
+
require_once( NIMBLE_BASE_PATH . '/dev_logs.php' );
|
133 |
+
}
|
134 |
+
|
135 |
+
add_action('plugins_loaded', 'nimble_load_plugin_textdomain');
|
136 |
+
/**
|
137 |
+
* Load language files
|
138 |
+
* @action plugins_loaded
|
139 |
+
*/
|
140 |
+
function nimble_load_plugin_textdomain() {
|
141 |
+
// Note to self, the third argument must not be hardcoded, to account for relocated folders.
|
142 |
+
load_plugin_textdomain( 'nimble-builder' );
|
143 |
+
}
|
144 |
+
|
145 |
+
require_once( NIMBLE_BASE_PATH . '/inc/functions.php' );
|
146 |
+
|
147 |
+
// Fire the retro compatibility functions
|
148 |
+
// Note : if fired @plugins_loaded, invoking wp_update_post() generates php notices
|
149 |
+
//add_action( 'wp_loaded', '\Nimble\sek_maybe_do_version_mapping' );
|
150 |
+
// introduced for https://github.com/presscustomizr/nimble-builder/issues/799
|
151 |
+
add_action( 'wp_loaded', '\Nimble\sek_maybe_optimize_options' );
|
152 |
+
|
153 |
+
// Load admin
|
154 |
+
if ( is_admin() ) {
|
155 |
+
require_once( NIMBLE_BASE_PATH . '/inc/admin/nimble-admin.php' );
|
156 |
+
do_action('nimble_admin_loaded');
|
157 |
+
}
|
158 |
+
|
159 |
+
// Load nimblizer
|
160 |
+
if ( is_admin() && defined('NIMBLIZER_ENABLED') && NIMBLIZER_ENABLED ) {
|
161 |
+
require_once( NIMBLE_BASE_PATH . '/inc/nimblizer/nimblizer-functions.php' );
|
162 |
+
do_action('nimblizer_loaded');
|
163 |
+
}
|
164 |
}//if ( nimble_passes_requirements() )
|
readme.txt
CHANGED
@@ -1,133 +1,134 @@
|
|
1 |
-
=== Nimble Page Builder ===
|
2 |
-
Contributors: nikeo, d4z_c0nf
|
3 |
-
Author URI: https://nimblebuilder.com
|
4 |
-
Plugin URI: https://wordpress.org/plugins/nimble-builder/
|
5 |
-
Tags: page builder, visual editor, customizer, drag and drop, header, footer, landing page, contact form, grid, post grid
|
6 |
-
Requires at least: 4.7
|
7 |
-
Requires PHP: 5.4
|
8 |
-
Tested up to: 5.9
|
9 |
-
Stable tag: 3.1.
|
10 |
-
License: GPLv3
|
11 |
-
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
|
13 |
-
|
14 |
-
Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
15 |
-
|
16 |
-
== Description ==
|
17 |
-
= What is Nimble Page Builder ? =
|
18 |
-
**[Nimble Page Builder](https://nimblebuilder.com/)** is a fast and agile page builder plugin for WordPress. Nimble Builder uses the live customizer, native and powerful WordPress interface for real-time design.
|
19 |
-
The plugin allows you to easily drag-and-drop modules like text-editor, post grids, images, contact forms, maps, icons, or ready-made sections and starter templates into any page of your site. You can edit your pages in real-time, and then click "publish" when you are happy with the result.
|
20 |
-
|
21 |
-
Watch the video below to see how this [demo page](https://demo.presscustomizr.com/nimble-builder/) has been built.
|
22 |
-
|
23 |
-
[vimeo https://vimeo.com/328473405]
|
24 |
-
|
25 |
-
= Live demos =
|
26 |
-
* [landing page with header and footer](https://nimblebuilder.com/landing-page-with-header-and-footer/)
|
27 |
-
* [integration with the Customizr theme](https://demo.presscustomizr.com/nimble-builder/)
|
28 |
-
* [integration with the Hueman theme](https://demo-hueman.presscustomizr.com/nimble-builder/)
|
29 |
-
* [404 page created with Nimble Builder](https://docs.presscustomizr.com/article/372-design-your-404-page-with-the-nimble-builder/)
|
30 |
-
|
31 |
-
= Works on any page of your site and with all WordPress themes =
|
32 |
-
Nimble Builder allows you to insert sections in any context of your site : home page, single post or page, category or tag page, even search results or [404 pages](https://docs.presscustomizr.com/article/372-design-your-404-page-with-the-nimble-builder/). No only that, you can also decide to [start designing from a blank page](https://docs.presscustomizr.com/article/371-how-to-start-building-from-a-blank-page-with-the-wordpress-nimble-builder/) on any page of your site, and even create a custom header and footer. Nimble Builder uses native WordPress action hooks, which makes it compatible with all WordPress themes.
|
33 |
-
|
34 |
-
= Features overview =
|
35 |
-
* **Drag and drop neatly pre-designed sections** and customize them in real-time preview.
|
36 |
-
* **Works in any WordPress contexts** : home, pages, posts, custom post types, archives, author pages, search page, ...
|
37 |
-
* Create content, style, move / duplicate / remove elements **in real-time preview**.
|
38 |
-
* Save and reuse sections and templates.
|
39 |
-
* **Site building** : define [site templates](https://docs.presscustomizr.com/article/428-how-to-use-site-templates-with-nimble-builder) for pages, posts, archives, search page, author pages, 404 page.
|
40 |
-
* **Many content modules available** : classic text editor, image, column layouts, contact form, button, icons, map, html code, WordPress widget area, menu, and more.
|
41 |
-
* **Insert engaging [post grids](https://docs.presscustomizr.com/article/393-how-to-add-post-grids-to-any-wordpress-page-with-nimble-builder/)** on any page, looking great on desktop and mobile devices.
|
42 |
-
* Use **full width image or video backgrounds** for your sections, and [enable a parallax effect](https://docs.presscustomizr.com/article/380-how-to-set-a-parallax-background-for-a-section-in-wordpress-with-the-nimble-builder/).
|
43 |
-
* **Easily [customize your content specifically for mobile devices](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder/)** : change the responsive breakpoint, adapt font-size, spacing, alignment, column layouts, in real-time preview.
|
44 |
-
* **Customize any text [with Google Fonts](https://docs.presscustomizr.com/article/364-how-to-use-google-fonts-with-the-nimble-builder/)**.
|
45 |
-
* Add **[custom CSS](https://docs.presscustomizr.com/article/409-how-to-add-custom-css-to-a-specific-page-of-your-wordpress-site/)** to any specific page of your site ( and only to this page ) : post, page, archive, 404 page, WooCommerce product, etc.
|
46 |
-
* **[Export / Import](https://docs.presscustomizr.com/article/391-how-to-export-and-import-templates-with-nimble-builder)** : re-use your sections in other pages and between sites.
|
47 |
-
* **[Embed shortcodes](https://docs.presscustomizr.com/article/350-how-to-use-shortcodes-from-other-plugins-with-the-nimble-builder-plugin/) from other plugins**, and see the result in real-time preview.
|
48 |
-
* Nimble Builder automatically generates responsive HTML markup for a **pixel-perfect rendering on smartphones and tablets**.
|
49 |
-
* Nimble Builder leverages the WordPress live customizer features for auto-drafting and schedule publishing. You can safely build and save drafts of your content before deploying in production.
|
50 |
-
|
51 |
-
= Mind blowing performances 🚀 =
|
52 |
-
Nimble Builder pages load very fast, in particular on mobile devices. With a basic cache server configuration, the plugin gets an A grade on performance tests.
|
53 |
-
|
54 |
-
= Mobile first builder =
|
55 |
-
Nimble Builder is designed **[mobile-first](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder)**. It uses a performant and lightweight flex CSS foundation which ensures perfect rendering on mobile devices. The plugin is an effective productivity tool, ideal for quickly sketching and publishing pages with sections and columns. Nimble Builder generates clean and fluid HTML markup that meets the highest SEO and accessibility standards.
|
56 |
-
|
57 |
-
= Content modules =
|
58 |
-
* Headings
|
59 |
-
* WordPress text editor ( support blocks and shortcodes )
|
60 |
-
* [Image](https://docs.presscustomizr.com/article/381-how-to-enable-lightbox-on-your-images-with-the-nimble-builder/)
|
61 |
-
* Button
|
62 |
-
* Icon
|
63 |
-
* Post Grid
|
64 |
-
* Image Carousel
|
65 |
-
* [Contact Form](https://docs.presscustomizr.com/article/385-how-to-enable-recaptcha-protection-against-spam-in-your-forms-with-the-nimble-builder/)
|
66 |
-
* [Google Map](https://docs.presscustomizr.com/article/387-how-to-insert-google-maps-in-your-wordpress-pages-with-the-nimble-builder/)
|
67 |
-
* Menu
|
68 |
-
* Social Profiles
|
69 |
-
* Divider
|
70 |
-
* Spacer
|
71 |
-
* Columns
|
72 |
-
* Quote
|
73 |
-
* Widget zone
|
74 |
-
* Accordion
|
75 |
-
* Shortcode
|
76 |
-
* Tabs ( coming soon )
|
77 |
-
* ... and more to come !
|
78 |
-
|
79 |
-
= Getting started =
|
80 |
-
Once [installed](https://docs.presscustomizr.com/article/347-installing-the-nimble-builder-plugin/), Nimble Builder can be accessed in the WordPress live customizer. You can [start creating your first section](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin/) !
|
81 |
-
|
82 |
-
== Documentation ==
|
83 |
-
You'll find a growing online knowledge base for Nimble builder here : [Nimble builder documentation](https://docs.presscustomizr.com/collection/334-nimble-builder/).
|
84 |
-
|
85 |
-
* [Getting started with Nimble Page Builder for WordPress](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin)
|
86 |
-
* [Technical requirements for Nimble Builder : server, browser, php version, WP version](https://docs.presscustomizr.com/article/355-technical-requirements-server-browser-php-version-wordpress-version)
|
87 |
-
* [Designing for mobile devices with the WordPress Nimble Builder](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder)
|
88 |
-
* [How to start building from a blank page with the WordPress Nimble Builder?](https://docs.presscustomizr.com/article/371-how-to-start-building-from-a-blank-page-with-the-wordpress-nimble-builder)
|
89 |
-
* [How to build your WordPress header and footer with Nimble Builder ?](https://docs.presscustomizr.com/article/358-building-your-header-and-footer-with-the-nimble-builder)
|
90 |
-
* [How to set a parallax background for a section in WordPress with Nimble Builder ?](https://docs.presscustomizr.com/article/380-how-to-set-a-parallax-background-for-a-section-in-wordpress-with-the-nimble-builder)
|
91 |
-
* [How to enable reCAPTCHA protection against spam in your forms with Nimble Builder?](https://docs.presscustomizr.com/article/385-how-to-enable-recaptcha-protection-against-spam-in-your-forms-with-the-nimble-builder)
|
92 |
-
* [How to change the page template with Nimble Builder ?](https://docs.presscustomizr.com/article/339-changing-the-page-template)
|
93 |
-
|
94 |
-
== Screenshots ==
|
95 |
-
1. Creating a page with 3 sections
|
96 |
-
2. Dragging and dropping a pre-designed section
|
97 |
-
3. Editing content in live preview
|
98 |
-
4. Creating columns layouts
|
99 |
-
5. Customizing a section with an image background
|
100 |
-
6. Using the section navigator
|
101 |
-
|
102 |
-
== Installation ==
|
103 |
-
1. Install the plugin through the WordPress plugins screen. Or download the plugin, unzip the package and upload it to your /wp-content/plugins/ directory
|
104 |
-
2. Activate the plugin through the 'Plugins' screen in WordPress
|
105 |
-
3. Navigate to the WordPress live customizer
|
106 |
-
4. Look for a drop zone candidate in the previewed page and click on the "+" button to start building your first section of content
|
107 |
-
5. Drag a module from the left panel and drop it in a drop zone of the previewed page
|
108 |
-
|
109 |
-
== Frequently Asked Questions ==
|
110 |
-
= How do I use Nimble Builder ? =
|
111 |
-
|
112 |
-
[Getting started with Nimble Page Builder for WordPress](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin/).
|
113 |
-
|
114 |
-
= Can I use Nimble Builder with any theme ? =
|
115 |
-
|
116 |
-
Yes, Nimble builder works with any WordPress theme. If you experience any problem with a specific theme, please report it in the [plugin support forum](https://wordpress.org/support/plugin/nimble-builder).
|
117 |
-
|
118 |
-
= How to troubleshoot problems with Nimble Builder ? =
|
119 |
-
1. **Use the latest software versions** : make sure WordPress, your theme and plugins are **all updated to their latest versions**.
|
120 |
-
2. **Cache plugin** : if you use a server cache or cache plugin, clear it’s cache content. It is recommended to disable your cache plugin when customizing your site.
|
121 |
-
3. **Browser** : [clear your browser's cache / history](https://docs.presscustomizr.com/article/309-how-to-clear-your-browsers-cache-cookies-and-history/). Switch to another browser if needed. Make sure you do not use a browser extension that conflicts with the plugin.
|
122 |
-
4. **Check for plugin conflict** : install WordPress official [Health check plugin](https://wordpress.org/plugins/health-check/). Activate the troubleshooting mode. Then deactivate all of your plugins. If it fixes the issue, re-activate your plugins one by one, until you identify the plugin in conflict.
|
123 |
-
5. **Theme** : install WordPress official [Health check plugin](https://wordpress.org/plugins/health-check/) and try to switch to another WordPress theme, like the default WordPress theme. If you use a child theme, activate the parent theme instead.
|
124 |
-
6. **Search the forum** : use the search field on top of the topic list with keywords describing your issue. Another user may have had a similar problem already resolved.
|
125 |
-
7. **Documentation** : try to find a possible solution in our [documentation pages](https://docs.presscustomizr.com/collection/334-nimble-builder/).
|
126 |
-
|
127 |
-
You can report a problem by opening a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
|
128 |
-
|
129 |
-
== Upgrade Notice ==
|
130 |
-
Visit the [Github release page](https://github.com/presscustomizr/nimble-builder/releases).
|
131 |
-
|
132 |
-
== Changelog ==
|
133 |
-
|
|
1 |
+
=== Nimble Page Builder ===
|
2 |
+
Contributors: nikeo, d4z_c0nf
|
3 |
+
Author URI: https://nimblebuilder.com
|
4 |
+
Plugin URI: https://wordpress.org/plugins/nimble-builder/
|
5 |
+
Tags: page builder, visual editor, customizer, drag and drop, header, footer, landing page, contact form, grid, post grid
|
6 |
+
Requires at least: 4.7
|
7 |
+
Requires PHP: 5.4
|
8 |
+
Tested up to: 5.9
|
9 |
+
Stable tag: 3.1.33
|
10 |
+
License: GPLv3
|
11 |
+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
|
13 |
+
|
14 |
+
Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
|
15 |
+
|
16 |
+
== Description ==
|
17 |
+
= What is Nimble Page Builder ? =
|
18 |
+
**[Nimble Page Builder](https://nimblebuilder.com/)** is a fast and agile page builder plugin for WordPress. Nimble Builder uses the live customizer, native and powerful WordPress interface for real-time design.
|
19 |
+
The plugin allows you to easily drag-and-drop modules like text-editor, post grids, images, contact forms, maps, icons, or ready-made sections and starter templates into any page of your site. You can edit your pages in real-time, and then click "publish" when you are happy with the result.
|
20 |
+
|
21 |
+
Watch the video below to see how this [demo page](https://demo.presscustomizr.com/nimble-builder/) has been built.
|
22 |
+
|
23 |
+
[vimeo https://vimeo.com/328473405]
|
24 |
+
|
25 |
+
= Live demos =
|
26 |
+
* [landing page with header and footer](https://nimblebuilder.com/landing-page-with-header-and-footer/)
|
27 |
+
* [integration with the Customizr theme](https://demo.presscustomizr.com/nimble-builder/)
|
28 |
+
* [integration with the Hueman theme](https://demo-hueman.presscustomizr.com/nimble-builder/)
|
29 |
+
* [404 page created with Nimble Builder](https://docs.presscustomizr.com/article/372-design-your-404-page-with-the-nimble-builder/)
|
30 |
+
|
31 |
+
= Works on any page of your site and with all WordPress themes =
|
32 |
+
Nimble Builder allows you to insert sections in any context of your site : home page, single post or page, category or tag page, even search results or [404 pages](https://docs.presscustomizr.com/article/372-design-your-404-page-with-the-nimble-builder/). No only that, you can also decide to [start designing from a blank page](https://docs.presscustomizr.com/article/371-how-to-start-building-from-a-blank-page-with-the-wordpress-nimble-builder/) on any page of your site, and even create a custom header and footer. Nimble Builder uses native WordPress action hooks, which makes it compatible with all WordPress themes.
|
33 |
+
|
34 |
+
= Features overview =
|
35 |
+
* **Drag and drop neatly pre-designed sections** and customize them in real-time preview.
|
36 |
+
* **Works in any WordPress contexts** : home, pages, posts, custom post types, archives, author pages, search page, ...
|
37 |
+
* Create content, style, move / duplicate / remove elements **in real-time preview**.
|
38 |
+
* Save and reuse sections and templates.
|
39 |
+
* **Site building** : define [site templates](https://docs.presscustomizr.com/article/428-how-to-use-site-templates-with-nimble-builder) for pages, posts, archives, search page, author pages, 404 page.
|
40 |
+
* **Many content modules available** : classic text editor, image, column layouts, contact form, button, icons, map, html code, WordPress widget area, menu, and more.
|
41 |
+
* **Insert engaging [post grids](https://docs.presscustomizr.com/article/393-how-to-add-post-grids-to-any-wordpress-page-with-nimble-builder/)** on any page, looking great on desktop and mobile devices.
|
42 |
+
* Use **full width image or video backgrounds** for your sections, and [enable a parallax effect](https://docs.presscustomizr.com/article/380-how-to-set-a-parallax-background-for-a-section-in-wordpress-with-the-nimble-builder/).
|
43 |
+
* **Easily [customize your content specifically for mobile devices](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder/)** : change the responsive breakpoint, adapt font-size, spacing, alignment, column layouts, in real-time preview.
|
44 |
+
* **Customize any text [with Google Fonts](https://docs.presscustomizr.com/article/364-how-to-use-google-fonts-with-the-nimble-builder/)**.
|
45 |
+
* Add **[custom CSS](https://docs.presscustomizr.com/article/409-how-to-add-custom-css-to-a-specific-page-of-your-wordpress-site/)** to any specific page of your site ( and only to this page ) : post, page, archive, 404 page, WooCommerce product, etc.
|
46 |
+
* **[Export / Import](https://docs.presscustomizr.com/article/391-how-to-export-and-import-templates-with-nimble-builder)** : re-use your sections in other pages and between sites.
|
47 |
+
* **[Embed shortcodes](https://docs.presscustomizr.com/article/350-how-to-use-shortcodes-from-other-plugins-with-the-nimble-builder-plugin/) from other plugins**, and see the result in real-time preview.
|
48 |
+
* Nimble Builder automatically generates responsive HTML markup for a **pixel-perfect rendering on smartphones and tablets**.
|
49 |
+
* Nimble Builder leverages the WordPress live customizer features for auto-drafting and schedule publishing. You can safely build and save drafts of your content before deploying in production.
|
50 |
+
|
51 |
+
= Mind blowing performances 🚀 =
|
52 |
+
Nimble Builder pages load very fast, in particular on mobile devices. With a basic cache server configuration, the plugin gets an A grade on performance tests.
|
53 |
+
|
54 |
+
= Mobile first builder =
|
55 |
+
Nimble Builder is designed **[mobile-first](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder)**. It uses a performant and lightweight flex CSS foundation which ensures perfect rendering on mobile devices. The plugin is an effective productivity tool, ideal for quickly sketching and publishing pages with sections and columns. Nimble Builder generates clean and fluid HTML markup that meets the highest SEO and accessibility standards.
|
56 |
+
|
57 |
+
= Content modules =
|
58 |
+
* Headings
|
59 |
+
* WordPress text editor ( support blocks and shortcodes )
|
60 |
+
* [Image](https://docs.presscustomizr.com/article/381-how-to-enable-lightbox-on-your-images-with-the-nimble-builder/)
|
61 |
+
* Button
|
62 |
+
* Icon
|
63 |
+
* Post Grid
|
64 |
+
* Image Carousel
|
65 |
+
* [Contact Form](https://docs.presscustomizr.com/article/385-how-to-enable-recaptcha-protection-against-spam-in-your-forms-with-the-nimble-builder/)
|
66 |
+
* [Google Map](https://docs.presscustomizr.com/article/387-how-to-insert-google-maps-in-your-wordpress-pages-with-the-nimble-builder/)
|
67 |
+
* Menu
|
68 |
+
* Social Profiles
|
69 |
+
* Divider
|
70 |
+
* Spacer
|
71 |
+
* Columns
|
72 |
+
* Quote
|
73 |
+
* Widget zone
|
74 |
+
* Accordion
|
75 |
+
* Shortcode
|
76 |
+
* Tabs ( coming soon )
|
77 |
+
* ... and more to come !
|
78 |
+
|
79 |
+
= Getting started =
|
80 |
+
Once [installed](https://docs.presscustomizr.com/article/347-installing-the-nimble-builder-plugin/), Nimble Builder can be accessed in the WordPress live customizer. You can [start creating your first section](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin/) !
|
81 |
+
|
82 |
+
== Documentation ==
|
83 |
+
You'll find a growing online knowledge base for Nimble builder here : [Nimble builder documentation](https://docs.presscustomizr.com/collection/334-nimble-builder/).
|
84 |
+
|
85 |
+
* [Getting started with Nimble Page Builder for WordPress](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin)
|
86 |
+
* [Technical requirements for Nimble Builder : server, browser, php version, WP version](https://docs.presscustomizr.com/article/355-technical-requirements-server-browser-php-version-wordpress-version)
|
87 |
+
* [Designing for mobile devices with the WordPress Nimble Builder](https://docs.presscustomizr.com/article/343-designing-for-mobile-devices-with-wordpress-nimble-builder)
|
88 |
+
* [How to start building from a blank page with the WordPress Nimble Builder?](https://docs.presscustomizr.com/article/371-how-to-start-building-from-a-blank-page-with-the-wordpress-nimble-builder)
|
89 |
+
* [How to build your WordPress header and footer with Nimble Builder ?](https://docs.presscustomizr.com/article/358-building-your-header-and-footer-with-the-nimble-builder)
|
90 |
+
* [How to set a parallax background for a section in WordPress with Nimble Builder ?](https://docs.presscustomizr.com/article/380-how-to-set-a-parallax-background-for-a-section-in-wordpress-with-the-nimble-builder)
|
91 |
+
* [How to enable reCAPTCHA protection against spam in your forms with Nimble Builder?](https://docs.presscustomizr.com/article/385-how-to-enable-recaptcha-protection-against-spam-in-your-forms-with-the-nimble-builder)
|
92 |
+
* [How to change the page template with Nimble Builder ?](https://docs.presscustomizr.com/article/339-changing-the-page-template)
|
93 |
+
|
94 |
+
== Screenshots ==
|
95 |
+
1. Creating a page with 3 sections
|
96 |
+
2. Dragging and dropping a pre-designed section
|
97 |
+
3. Editing content in live preview
|
98 |
+
4. Creating columns layouts
|
99 |
+
5. Customizing a section with an image background
|
100 |
+
6. Using the section navigator
|
101 |
+
|
102 |
+
== Installation ==
|
103 |
+
1. Install the plugin through the WordPress plugins screen. Or download the plugin, unzip the package and upload it to your /wp-content/plugins/ directory
|
104 |
+
2. Activate the plugin through the 'Plugins' screen in WordPress
|
105 |
+
3. Navigate to the WordPress live customizer
|
106 |
+
4. Look for a drop zone candidate in the previewed page and click on the "+" button to start building your first section of content
|
107 |
+
5. Drag a module from the left panel and drop it in a drop zone of the previewed page
|
108 |
+
|
109 |
+
== Frequently Asked Questions ==
|
110 |
+
= How do I use Nimble Builder ? =
|
111 |
+
|
112 |
+
[Getting started with Nimble Page Builder for WordPress](https://docs.presscustomizr.com/article/337-getting-started-with-the-nimble-builder-plugin/).
|
113 |
+
|
114 |
+
= Can I use Nimble Builder with any theme ? =
|
115 |
+
|
116 |
+
Yes, Nimble builder works with any WordPress theme. If you experience any problem with a specific theme, please report it in the [plugin support forum](https://wordpress.org/support/plugin/nimble-builder).
|
117 |
+
|
118 |
+
= How to troubleshoot problems with Nimble Builder ? =
|
119 |
+
1. **Use the latest software versions** : make sure WordPress, your theme and plugins are **all updated to their latest versions**.
|
120 |
+
2. **Cache plugin** : if you use a server cache or cache plugin, clear it’s cache content. It is recommended to disable your cache plugin when customizing your site.
|
121 |
+
3. **Browser** : [clear your browser's cache / history](https://docs.presscustomizr.com/article/309-how-to-clear-your-browsers-cache-cookies-and-history/). Switch to another browser if needed. Make sure you do not use a browser extension that conflicts with the plugin.
|
122 |
+
4. **Check for plugin conflict** : install WordPress official [Health check plugin](https://wordpress.org/plugins/health-check/). Activate the troubleshooting mode. Then deactivate all of your plugins. If it fixes the issue, re-activate your plugins one by one, until you identify the plugin in conflict.
|
123 |
+
5. **Theme** : install WordPress official [Health check plugin](https://wordpress.org/plugins/health-check/) and try to switch to another WordPress theme, like the default WordPress theme. If you use a child theme, activate the parent theme instead.
|
124 |
+
6. **Search the forum** : use the search field on top of the topic list with keywords describing your issue. Another user may have had a similar problem already resolved.
|
125 |
+
7. **Documentation** : try to find a possible solution in our [documentation pages](https://docs.presscustomizr.com/collection/334-nimble-builder/).
|
126 |
+
|
127 |
+
You can report a problem by opening a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
|
128 |
+
|
129 |
+
== Upgrade Notice ==
|
130 |
+
Visit the [Github release page](https://github.com/presscustomizr/nimble-builder/releases).
|
131 |
+
|
132 |
+
== Changelog ==
|
133 |
+
3/8/2022 Validation, Sanitization and Escaping
|
134 |
+
You'll find the latest changelog on the [Github page](https://github.com/presscustomizr/nimble-builder/releases).
|
tmpl/header/nimble_header_tmpl.php
CHANGED
@@ -28,7 +28,7 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
28 |
?>
|
29 |
<div id="nimble-page" class="">
|
30 |
<a class="sek-skip-link sek-screen-reader-text" href="#nimble-page"><?php _e( 'Skip to content', 'nimble-builder' ); ?></a>
|
31 |
-
<header id="nimble-header" class="<?php echo $header_classes; ?>">
|
32 |
<?php do_action('before_nimble_header'); ?>
|
33 |
<?php Nimble_Manager()->render_nimble_locations( true === Nimble_Manager()->has_local_header_footer ? 'nimble_local_header' :'nimble_global_header' ); ?>
|
34 |
</header><!-- #nimble-header -->
|
28 |
?>
|
29 |
<div id="nimble-page" class="">
|
30 |
<a class="sek-skip-link sek-screen-reader-text" href="#nimble-page"><?php _e( 'Skip to content', 'nimble-builder' ); ?></a>
|
31 |
+
<header id="nimble-header" class="<?php echo esc_attr($header_classes); ?>">
|
32 |
<?php do_action('before_nimble_header'); ?>
|
33 |
<?php Nimble_Manager()->render_nimble_locations( true === Nimble_Manager()->has_local_header_footer ? 'nimble_local_header' :'nimble_global_header' ); ?>
|
34 |
</header><!-- #nimble-header -->
|
tmpl/modules/divider_module_tmpl.php
CHANGED
@@ -4,4 +4,4 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
-
echo '<span class="sek-divider"></span>';
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
+
echo esc_html('<span class="sek-divider"></span>');
|
tmpl/modules/featured_pages_module_tmpl.php
CHANGED
@@ -147,7 +147,7 @@ endif;
|
|
147 |
<div class="sek-row marketing"><?php //js-center-images-disabled ?>
|
148 |
|
149 |
<?php foreach ( $value as $fp ) : ?>
|
150 |
-
<div class="sek-col-base sek-col-<?php echo $fp_col_suffix ?>">
|
151 |
<div class="sek-fp-widget sek-link-mask-p round">
|
152 |
<?php
|
153 |
// normalizes
|
@@ -163,8 +163,8 @@ endif;
|
|
163 |
$featured_page_id = $is_wp_post_type ? $fp[ 'page-id' ][ 'id' ] : '';
|
164 |
}
|
165 |
if ( empty( $is_custom_url ) && empty( $is_wp_post_type ) ):
|
166 |
-
echo '<h2>Feature Page temporary placeholder</h2>';
|
167 |
-
echo Nimble_Manager()->sek_get_input_placeholder_content( 'upload' );
|
168 |
else :
|
169 |
//DEFINITION
|
170 |
|
@@ -219,23 +219,23 @@ endif;
|
|
219 |
<?php /* SINGLE FP RENDERING*/
|
220 |
if ( $fp_image ) : /* FP IMAGE */?>
|
221 |
<div class="sek-fp-thumb-wrapper sek__r-wFP">
|
222 |
-
<a class="sek-link-mask" href="<?php echo $fp_link ?>" title="<?php echo $fp_title ?>"></a>
|
223 |
-
<?php echo $fp_image ?>
|
224 |
</div>
|
225 |
<?php
|
226 |
endif; /* END FP IMAGE*/
|
227 |
/* FP TITLE */
|
228 |
?>
|
229 |
-
<h4 class="sek-fp-title"><?php echo $fp_title ?></h4>
|
230 |
<?php
|
231 |
if ( $fp_text ) :
|
232 |
?>
|
233 |
-
<p class="sek-fp-text"><?php echo $fp_text ?></p>
|
234 |
<?php endif;/* END FP TEXT*/
|
235 |
/* FP BUTTON TEXT */
|
236 |
if ( $fp_button ) :
|
237 |
?>
|
238 |
-
<span class="sek-fp-button-holder"><a class="sek-btn sek-fp-btn-link" href="<?php
|
239 |
<?php
|
240 |
endif;/* END FP BUTTON TEXT*/
|
241 |
endif; /* end sek_fp_is_fp_set */
|
147 |
<div class="sek-row marketing"><?php //js-center-images-disabled ?>
|
148 |
|
149 |
<?php foreach ( $value as $fp ) : ?>
|
150 |
+
<div class="sek-col-base sek-col-<?php echo esc_attr($fp_col_suffix); ?>">
|
151 |
<div class="sek-fp-widget sek-link-mask-p round">
|
152 |
<?php
|
153 |
// normalizes
|
163 |
$featured_page_id = $is_wp_post_type ? $fp[ 'page-id' ][ 'id' ] : '';
|
164 |
}
|
165 |
if ( empty( $is_custom_url ) && empty( $is_wp_post_type ) ):
|
166 |
+
echo esc_html('<h2>Feature Page temporary placeholder</h2>');
|
167 |
+
echo esc_html(Nimble_Manager()->sek_get_input_placeholder_content( 'upload' ));
|
168 |
else :
|
169 |
//DEFINITION
|
170 |
|
219 |
<?php /* SINGLE FP RENDERING*/
|
220 |
if ( $fp_image ) : /* FP IMAGE */?>
|
221 |
<div class="sek-fp-thumb-wrapper sek__r-wFP">
|
222 |
+
<a class="sek-link-mask" href="<?php echo esc_attr($fp_link); ?>" title="<?php echo esc_attr($fp_title); ?>"></a>
|
223 |
+
<?php echo esc_html($fp_image); ?>
|
224 |
</div>
|
225 |
<?php
|
226 |
endif; /* END FP IMAGE*/
|
227 |
/* FP TITLE */
|
228 |
?>
|
229 |
+
<h4 class="sek-fp-title"><?php echo esc_html($fp_title); ?></h4>
|
230 |
<?php
|
231 |
if ( $fp_text ) :
|
232 |
?>
|
233 |
+
<p class="sek-fp-text"><?php echo esc_html($fp_text); ?></p>
|
234 |
<?php endif;/* END FP TEXT*/
|
235 |
/* FP BUTTON TEXT */
|
236 |
if ( $fp_button ) :
|
237 |
?>
|
238 |
+
<span class="sek-fp-button-holder"><a class="sek-btn sek-fp-btn-link" href="<?php esc_attr($fp_link); ?>" title="<?php echo esc_attr($fp_title) ?>"><?php echo esc_html($fp_button_text); ?></a></span>
|
239 |
<?php
|
240 |
endif;/* END FP BUTTON TEXT*/
|
241 |
endif; /* end sek_fp_is_fp_set */
|
tmpl/modules/gallery_tmpl.php
CHANGED
@@ -172,13 +172,13 @@ if ( !function_exists( 'Nimble\sek_print_gallery_mod' ) ) {
|
|
172 |
do_action( 'nb_before_post_gal_wrapper' );
|
173 |
?>
|
174 |
|
175 |
-
<div class="sek-gal-wrapper <?php echo $gal_wrapper_classes; ?>" id="<?php echo $model['id']; ?>">
|
176 |
-
<div class="sek-gal-items <?php echo $gal_items_classes; ?>">
|
177 |
<?php foreach ( $gallery_collec as $index => $item ) : ?>
|
178 |
-
<figure class="sek-img-gal-item" data-sek-item-id="<?php echo $item['id']; ?>">
|
179 |
<?php
|
180 |
if ( 'no-link' === $gallery_opts['link-to'] ) {
|
181 |
-
echo sek_get_gal_img_item_html( $item, $gallery_opts );
|
182 |
} else {
|
183 |
$link = sek_get_gal_img_link( $item, $gallery_opts );
|
184 |
printf('<a class="%4$s %5$s" href="%1$s" %2$s title="%6$s">%3$s</a>',
|
172 |
do_action( 'nb_before_post_gal_wrapper' );
|
173 |
?>
|
174 |
|
175 |
+
<div class="sek-gal-wrapper <?php echo esc_attr($gal_wrapper_classes); ?>" id="<?php echo esc_attr($model['id']); ?>">
|
176 |
+
<div class="sek-gal-items <?php echo esc_attr($gal_items_classes); ?>">
|
177 |
<?php foreach ( $gallery_collec as $index => $item ) : ?>
|
178 |
+
<figure class="sek-img-gal-item" data-sek-item-id="<?php echo esc_attr($item['id']); ?>">
|
179 |
<?php
|
180 |
if ( 'no-link' === $gallery_opts['link-to'] ) {
|
181 |
+
echo esc_html(sek_get_gal_img_item_html( $item, $gallery_opts ));
|
182 |
} else {
|
183 |
$link = sek_get_gal_img_link( $item, $gallery_opts );
|
184 |
printf('<a class="%4$s %5$s" href="%1$s" %2$s title="%6$s">%3$s</a>',
|
tmpl/modules/heading_module_tmpl.php
CHANGED
@@ -43,9 +43,9 @@ if ( !function_exists( 'Nimble\sek_print_text_heading_content' ) ) {
|
|
43 |
}
|
44 |
}
|
45 |
if ( $echo ) {
|
46 |
-
echo $to_print;
|
47 |
} else {
|
48 |
-
return $to_print;
|
49 |
}
|
50 |
|
51 |
}
|
43 |
}
|
44 |
}
|
45 |
if ( $echo ) {
|
46 |
+
echo esc_html($to_print);
|
47 |
} else {
|
48 |
+
return esc_html($to_print);
|
49 |
}
|
50 |
|
51 |
}
|
tmpl/modules/image_module_tmpl.php
CHANGED
@@ -160,7 +160,7 @@ if ( !function_exists( 'Nimble\sek_get_img_module_img_link' ) ) {
|
|
160 |
|
161 |
// Print
|
162 |
if ( 'no-link' === $main_settings['link-to'] ) {
|
163 |
-
echo apply_filters('nb_img_module_html', sek_get_img_module_img_html( $main_settings ), $main_settings );
|
164 |
} else {
|
165 |
$link = sek_get_img_module_img_link( $main_settings );
|
166 |
printf('<a class="%4$s %5$s" href="%1$s" %2$s>%3$s</a>',
|
160 |
|
161 |
// Print
|
162 |
if ( 'no-link' === $main_settings['link-to'] ) {
|
163 |
+
echo esc_html(apply_filters('nb_img_module_html', sek_get_img_module_img_html( $main_settings ), $main_settings ));
|
164 |
} else {
|
165 |
$link = sek_get_img_module_img_link( $main_settings );
|
166 |
printf('<a class="%4$s %5$s" href="%1$s" %2$s>%3$s</a>',
|
tmpl/modules/img_slider_tmpl.php
CHANGED
@@ -253,18 +253,18 @@ if ( !function_exists( 'Nimble\sek_print_img_slider' ) ) {
|
|
253 |
</div><?php //.swiper-wrapper ?>
|
254 |
<?php endif; ?>
|
255 |
<?php if ( in_array($nav_type,array('arrows_dots', 'dots') ) && $is_multislide ) : ?>
|
256 |
-
<div class="swiper-pagination swiper-pagination<?php echo $model['id']; ?>"></div>
|
257 |
<?php endif; ?>
|
258 |
|
259 |
<?php if ( in_array($nav_type,array('arrows_dots', 'arrows') ) && $is_multislide ) : ?>
|
260 |
<div class="sek-swiper-nav">
|
261 |
-
<div class="sek-swiper-arrows sek-swiper-prev sek-swiper-prev<?php echo $model['id']; ?>" title="<?php _e('previous', 'nimble-builder'); ?>"><div class="sek-chevron"></div></div>
|
262 |
-
<div class="sek-swiper-arrows sek-swiper-next sek-swiper-next<?php echo $model['id']; ?>" title="<?php _e('next', 'nimble-builder'); ?>"><div class="sek-chevron"></div></div>
|
263 |
</div>
|
264 |
<?php endif; ?>
|
265 |
<?php
|
266 |
if ( !skp_is_customizing() ) {
|
267 |
-
echo Nimble_Manager()->css_loader_html;
|
268 |
}
|
269 |
?>
|
270 |
</div><?php //.swiper ?>
|
253 |
</div><?php //.swiper-wrapper ?>
|
254 |
<?php endif; ?>
|
255 |
<?php if ( in_array($nav_type,array('arrows_dots', 'dots') ) && $is_multislide ) : ?>
|
256 |
+
<div class="swiper-pagination swiper-pagination<?php echo esc_attr($model['id']); ?>"></div>
|
257 |
<?php endif; ?>
|
258 |
|
259 |
<?php if ( in_array($nav_type,array('arrows_dots', 'arrows') ) && $is_multislide ) : ?>
|
260 |
<div class="sek-swiper-nav">
|
261 |
+
<div class="sek-swiper-arrows sek-swiper-prev sek-swiper-prev<?php echo esc_attr($model['id']); ?>" title="<?php _e('previous', 'nimble-builder'); ?>"><div class="sek-chevron"></div></div>
|
262 |
+
<div class="sek-swiper-arrows sek-swiper-next sek-swiper-next<?php echo esc_attr($model['id']); ?>" title="<?php _e('next', 'nimble-builder'); ?>"><div class="sek-chevron"></div></div>
|
263 |
</div>
|
264 |
<?php endif; ?>
|
265 |
<?php
|
266 |
if ( !skp_is_customizing() ) {
|
267 |
+
echo esc_html(Nimble_Manager()->css_loader_html);
|
268 |
}
|
269 |
?>
|
270 |
</div><?php //.swiper ?>
|
tmpl/modules/menu_module_tmpl.php
CHANGED
@@ -26,8 +26,8 @@ sek_emit_js_event('nb-needs-menu-js');
|
|
26 |
// janv 2021 => added data-sek-mobile-menu-breakpoint attribute which is hard coded to min-width:768px for the moment
|
27 |
// in the future, this value could be set by users, see $grid-breakpoints in scss variables
|
28 |
?>
|
29 |
-
<nav class="<?php echo $nav_classes; ?>" data-sek-expand-below="<?php echo $expand_below; ?>" data-sek-mobile-menu-breakpoint=768>
|
30 |
-
<button class="sek-nav-toggler sek-collapsed" type="button" data-target="#<?php echo $model['id'] ?>" aria-controls="<?php echo $model['id'] ?>" aria-expanded="false" aria-label="<?php esc_attr_e( 'Toggle navigation', 'nimble-builder' ) ?>">
|
31 |
<span class="sek-ham__span-wrapper">
|
32 |
<span class="line line-1"></span>
|
33 |
<span class="line line-2"></span>
|
@@ -38,7 +38,7 @@ sek_emit_js_event('nb-needs-menu-js');
|
|
38 |
// WHY DO WE ADD this inline style display:none ?
|
39 |
// in the stylesheet, .sek-nav-collapse {display: flex!important;} => This hack allows us to prevent a Content Layout Shift on page load
|
40 |
?>
|
41 |
-
<div class="sek-nav-collapse <?php echo $sek_nav_collapse_additional_classes ?>" id="<?php echo $model['id'] ?>" data-sek-mm-state="collapsed" style="display:none">
|
42 |
<?php
|
43 |
// june 2020 : filter menu classes => added for https://github.com/presscustomizr/nimble-builder-pro/issues/9
|
44 |
$menu_classes = apply_filters( 'nb_wp_menu_classes', array( 'sek-menu-module', 'sek-nav' ), $model );
|
26 |
// janv 2021 => added data-sek-mobile-menu-breakpoint attribute which is hard coded to min-width:768px for the moment
|
27 |
// in the future, this value could be set by users, see $grid-breakpoints in scss variables
|
28 |
?>
|
29 |
+
<nav class="<?php echo esc_attr($nav_classes); ?>" data-sek-expand-below="<?php echo esc_attr($expand_below); ?>" data-sek-mobile-menu-breakpoint=768>
|
30 |
+
<button class="sek-nav-toggler sek-collapsed" type="button" data-target="#<?php echo esc_attr($model['id']); ?>" aria-controls="<?php echo esc_attr($model['id']); ?>" aria-expanded="false" aria-label="<?php esc_attr_e( 'Toggle navigation', 'nimble-builder' ) ?>">
|
31 |
<span class="sek-ham__span-wrapper">
|
32 |
<span class="line line-1"></span>
|
33 |
<span class="line line-2"></span>
|
38 |
// WHY DO WE ADD this inline style display:none ?
|
39 |
// in the stylesheet, .sek-nav-collapse {display: flex!important;} => This hack allows us to prevent a Content Layout Shift on page load
|
40 |
?>
|
41 |
+
<div class="sek-nav-collapse <?php echo esc_attr($sek_nav_collapse_additional_classes) ?>" id="<?php echo esc_attr($model['id']); ?>" data-sek-mm-state="collapsed" style="display:none">
|
42 |
<?php
|
43 |
// june 2020 : filter menu classes => added for https://github.com/presscustomizr/nimble-builder-pro/issues/9
|
44 |
$menu_classes = apply_filters( 'nb_wp_menu_classes', array( 'sek-menu-module', 'sek-nav' ), $model );
|
tmpl/modules/post_grid_module_tmpl.php
CHANGED
@@ -57,10 +57,10 @@ if ( !function_exists( 'Nimble\sek_render_post_navigation') ) {
|
|
57 |
<nav id="sek-nav-below" class="sek-col-100">
|
58 |
<h2 class="sek-screen-reader-text"><?php _e('Posts navigation', 'nimble-builder') ?></h2>
|
59 |
<ul class="sek-czr-pager sek-row">
|
60 |
-
<li class="sek-next-posts sek-col-base sek-col-33 <?php echo $tnext_align_class ?> ">
|
61 |
<?php if ( null != $next_link ) : ?>
|
62 |
-
<span class="sek-screen-reader-text"><?php echo $_newer_label ?></span>
|
63 |
-
<span class="sek-nav-next sek-nav-dir"><?php echo $next_link ?></span>
|
64 |
<?php endif ?>
|
65 |
</li>
|
66 |
<li class="sek-pagination sek-col-base sek-col-33">
|
@@ -74,7 +74,7 @@ if ( !function_exists( 'Nimble\sek_render_post_navigation') ) {
|
|
74 |
$paged = $paged ? $paged : 1;
|
75 |
$model = Nimble_Manager()->model;
|
76 |
$is_nimble_pagination = isset($_GET['nb_grid_module_go_to']);
|
77 |
-
$is_current_grid_paginated = $is_nimble_pagination && $model['id'] === $_GET['nb_grid_module_go_to'];
|
78 |
// When user clicked on a pagination link, NB adds query params to the url ( removed via js once the page is loaded )
|
79 |
// in this case, if there are several grids printed on the page we want to paginate only the paginated one
|
80 |
// otherwise, if the pagination is accessed directly, or if the page is refreshed, all grids should be paginated according to the get_query_var($pagination_query_var) param
|
@@ -95,16 +95,16 @@ if ( !function_exists( 'Nimble\sek_render_post_navigation') ) {
|
|
95 |
|
96 |
if ( is_array( $_paginate_links ) ) {
|
97 |
foreach ( $_paginate_links as $_page ) {
|
98 |
-
echo "<li class='sek-paginat-item'>$_page</li>";
|
99 |
}
|
100 |
}
|
101 |
?>
|
102 |
</ul>
|
103 |
</li>
|
104 |
-
<li class="sek-previous-posts sek-col-base sek-col-33 <?php echo $tprev_align_class ?>">
|
105 |
<?php if ( null != $prev_link ) : ?>
|
106 |
-
<span class="sek-screen-reader-text"><?php echo $_older_label ?></span>
|
107 |
-
<span class="sek-nav-previous sek-nav-dir"><?php echo $prev_link ?></span>
|
108 |
<?php endif; ?>
|
109 |
</li>
|
110 |
</ul>
|
@@ -165,9 +165,9 @@ if ( !function_exists( 'Nimble\sek_render_post') ) {
|
|
165 |
if ( !skp_is_customizing() && false !== strpos($img_html, 'data-sek-src="http') ) {
|
166 |
$img_html = $img_html.Nimble_Manager()->css_loader_html;
|
167 |
}
|
168 |
-
echo $img_html;
|
169 |
} else if ( $use_post_thumb_placeholder ) {
|
170 |
-
echo apply_filters( 'nimble_post_grid_module_default_featured_image', sprintf( '<img alt="default img" data-skip-lazyload="true" src="%1$s"/>', NIMBLE_BASE_URL . '/assets/img/default-img.png' ) );
|
171 |
}
|
172 |
?>
|
173 |
</a>
|
@@ -180,7 +180,7 @@ if ( !function_exists( 'Nimble\sek_render_post') ) {
|
|
180 |
<?php endif; ?>
|
181 |
<?php if ( $show_title ) : ?>
|
182 |
<h2 class="sek-pg-title">
|
183 |
-
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php echo get_the_title($post_id); ?></a>
|
184 |
</h2><!--/.pg-title-->
|
185 |
<?php endif; ?>
|
186 |
<?php if ( $show_author || $show_date || $show_comments ) : ?>
|
@@ -189,7 +189,7 @@ if ( !function_exists( 'Nimble\sek_render_post') ) {
|
|
189 |
<span><?php the_author_posts_link(); ?></span>
|
190 |
<?php endif; ?>
|
191 |
<?php if ( $show_date ) : ?>
|
192 |
-
<span class="published updated"><?php echo get_the_date( get_option('date_format') ); ?></span>
|
193 |
<?php endif; ?>
|
194 |
<?php if ( $show_comments ) : ?>
|
195 |
<span><?php comments_number( __('0 comments', 'nimble-builder'), __('1 comment', 'nimble-builder'), __('% comments', 'nimble-builder') ); ?></span>
|
@@ -202,7 +202,7 @@ if ( !function_exists( 'Nimble\sek_render_post') ) {
|
|
202 |
// note : using add_filter( 'excerpt_length' ) do not work when using a custom excerpt
|
203 |
// code inspired from WP core formatting.php
|
204 |
?>
|
205 |
-
<?php echo apply_filters( 'the_excerpt', wp_trim_words( get_the_excerpt(), sek_pg_get_excerpt_length( 55 ), ' ' . '[…]' ) ); ?>
|
206 |
</div>
|
207 |
<?php endif; ?>
|
208 |
</div><?php //.sek-pg-content ?>
|
@@ -387,7 +387,7 @@ if ( $use_current_query ) {
|
|
387 |
|
388 |
$paged = 1;
|
389 |
$is_nimble_pagination_on = isset($_GET['nb_grid_module_go_to']);
|
390 |
-
$is_current_grid_paginated = isset($_GET['nb_grid_module_go_to']) && $model['id'] === $_GET['nb_grid_module_go_to'];
|
391 |
// may 2020 => is_front_page() was wrong to check if home was a static front page.
|
392 |
// fixes https://github.com/presscustomizr/nimble-builder/issues/664
|
393 |
Nimble_Manager()->is_viewing_static_front_page = is_front_page() && 'page' == get_option( 'show_on_front' );
|
@@ -547,8 +547,8 @@ if ( is_object( $post_query ) && $post_query->have_posts() ) {
|
|
547 |
$grid_items_classes = implode(' ', $grid_items_classes );
|
548 |
do_action( 'nb_before_post_grid_wrapper' );
|
549 |
?>
|
550 |
-
<div class="sek-post-grid-wrapper <?php echo $grid_wrapper_classes; ?>" id="<?php echo $model['id']; ?>">
|
551 |
-
<div class="sek-grid-items <?php echo $grid_items_classes; ?>">
|
552 |
<?php
|
553 |
// $post_query->have_posts() fires 'loop_end', which we don't want
|
554 |
while ( sek_pg_the_nimble_have_post( $post_query ) ) {
|
57 |
<nav id="sek-nav-below" class="sek-col-100">
|
58 |
<h2 class="sek-screen-reader-text"><?php _e('Posts navigation', 'nimble-builder') ?></h2>
|
59 |
<ul class="sek-czr-pager sek-row">
|
60 |
+
<li class="sek-next-posts sek-col-base sek-col-33 <?php echo esc_attr($tnext_align_class); ?> ">
|
61 |
<?php if ( null != $next_link ) : ?>
|
62 |
+
<span class="sek-screen-reader-text"><?php echo esc_html($_newer_label); ?></span>
|
63 |
+
<span class="sek-nav-next sek-nav-dir"><?php echo esc_html($next_link); ?></span>
|
64 |
<?php endif ?>
|
65 |
</li>
|
66 |
<li class="sek-pagination sek-col-base sek-col-33">
|
74 |
$paged = $paged ? $paged : 1;
|
75 |
$model = Nimble_Manager()->model;
|
76 |
$is_nimble_pagination = isset($_GET['nb_grid_module_go_to']);
|
77 |
+
$is_current_grid_paginated = $is_nimble_pagination && $model['id'] === sanitize_text_field($_GET['nb_grid_module_go_to']);
|
78 |
// When user clicked on a pagination link, NB adds query params to the url ( removed via js once the page is loaded )
|
79 |
// in this case, if there are several grids printed on the page we want to paginate only the paginated one
|
80 |
// otherwise, if the pagination is accessed directly, or if the page is refreshed, all grids should be paginated according to the get_query_var($pagination_query_var) param
|
95 |
|
96 |
if ( is_array( $_paginate_links ) ) {
|
97 |
foreach ( $_paginate_links as $_page ) {
|
98 |
+
echo esc_html("<li class='sek-paginat-item'>$_page</li>");
|
99 |
}
|
100 |
}
|
101 |
?>
|
102 |
</ul>
|
103 |
</li>
|
104 |
+
<li class="sek-previous-posts sek-col-base sek-col-33 <?php echo esc_attr($tprev_align_class); ?>">
|
105 |
<?php if ( null != $prev_link ) : ?>
|
106 |
+
<span class="sek-screen-reader-text"><?php echo esc_html($_older_label) ?></span>
|
107 |
+
<span class="sek-nav-previous sek-nav-dir"><?php echo esc_html($prev_link) ?></span>
|
108 |
<?php endif; ?>
|
109 |
</li>
|
110 |
</ul>
|
165 |
if ( !skp_is_customizing() && false !== strpos($img_html, 'data-sek-src="http') ) {
|
166 |
$img_html = $img_html.Nimble_Manager()->css_loader_html;
|
167 |
}
|
168 |
+
echo esc_html($img_html);
|
169 |
} else if ( $use_post_thumb_placeholder ) {
|
170 |
+
echo esc_html(apply_filters( 'nimble_post_grid_module_default_featured_image', sprintf( '<img alt="default img" data-skip-lazyload="true" src="%1$s"/>', esc_url(NIMBLE_BASE_URL . '/assets/img/default-img.png') ) ));
|
171 |
}
|
172 |
?>
|
173 |
</a>
|
180 |
<?php endif; ?>
|
181 |
<?php if ( $show_title ) : ?>
|
182 |
<h2 class="sek-pg-title">
|
183 |
+
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php echo esc_html(get_the_title($post_id)); ?></a>
|
184 |
</h2><!--/.pg-title-->
|
185 |
<?php endif; ?>
|
186 |
<?php if ( $show_author || $show_date || $show_comments ) : ?>
|
189 |
<span><?php the_author_posts_link(); ?></span>
|
190 |
<?php endif; ?>
|
191 |
<?php if ( $show_date ) : ?>
|
192 |
+
<span class="published updated"><?php echo esc_html(get_the_date( get_option('date_format') )); ?></span>
|
193 |
<?php endif; ?>
|
194 |
<?php if ( $show_comments ) : ?>
|
195 |
<span><?php comments_number( __('0 comments', 'nimble-builder'), __('1 comment', 'nimble-builder'), __('% comments', 'nimble-builder') ); ?></span>
|
202 |
// note : using add_filter( 'excerpt_length' ) do not work when using a custom excerpt
|
203 |
// code inspired from WP core formatting.php
|
204 |
?>
|
205 |
+
<?php echo esc_html(apply_filters( 'the_excerpt', wp_trim_words( get_the_excerpt(), sek_pg_get_excerpt_length( 55 ), ' ' . '[…]' ) )); ?>
|
206 |
</div>
|
207 |
<?php endif; ?>
|
208 |
</div><?php //.sek-pg-content ?>
|
387 |
|
388 |
$paged = 1;
|
389 |
$is_nimble_pagination_on = isset($_GET['nb_grid_module_go_to']);
|
390 |
+
$is_current_grid_paginated = isset($_GET['nb_grid_module_go_to']) && $model['id'] === sanitize_text_field($_GET['nb_grid_module_go_to']);
|
391 |
// may 2020 => is_front_page() was wrong to check if home was a static front page.
|
392 |
// fixes https://github.com/presscustomizr/nimble-builder/issues/664
|
393 |
Nimble_Manager()->is_viewing_static_front_page = is_front_page() && 'page' == get_option( 'show_on_front' );
|
547 |
$grid_items_classes = implode(' ', $grid_items_classes );
|
548 |
do_action( 'nb_before_post_grid_wrapper' );
|
549 |
?>
|
550 |
+
<div class="sek-post-grid-wrapper <?php echo $grid_wrapper_classes; ?>" id="<?php echo esc_attr($model['id']); ?>">
|
551 |
+
<div class="sek-grid-items <?php echo esc_attr($grid_items_classes); ?>">
|
552 |
<?php
|
553 |
// $post_query->have_posts() fires 'loop_end', which we don't want
|
554 |
while ( sek_pg_the_nimble_have_post( $post_query ) ) {
|
tmpl/modules/quote_module_tmpl.php
CHANGED
@@ -31,9 +31,9 @@ if ( !function_exists( __NAMESPACE__ . '\sek_print_quote_content' ) ) {
|
|
31 |
}
|
32 |
|
33 |
if ( $echo ) {
|
34 |
-
echo $to_print;
|
35 |
} else {
|
36 |
-
return $to_print;
|
37 |
}
|
38 |
}
|
39 |
}
|
31 |
}
|
32 |
|
33 |
if ( $echo ) {
|
34 |
+
echo esc_html($to_print);
|
35 |
} else {
|
36 |
+
return esc_html($to_print);
|
37 |
}
|
38 |
}
|
39 |
}
|
tmpl/modules/simple_form_module_tmpl.php
CHANGED
@@ -19,6 +19,6 @@ if ( true === sek_booleanize_checkbox_val( $value['fields_design']['use_inset_sh
|
|
19 |
$visual_effect_class .= ' use-inset-shadow';
|
20 |
}
|
21 |
?>
|
22 |
-
<div class="sek-simple-form-wrapper <?php echo $visual_effect_class; ?>">
|
23 |
-
<?php echo Nimble_Manager()->get_simple_form_html( $model ); ?>
|
24 |
</div>
|
19 |
$visual_effect_class .= ' use-inset-shadow';
|
20 |
}
|
21 |
?>
|
22 |
+
<div class="sek-simple-form-wrapper <?php echo esc_attr($visual_effect_class); ?>">
|
23 |
+
<?php echo esc_html(Nimble_Manager()->get_simple_form_html( $model )); ?>
|
24 |
</div>
|
tmpl/modules/simple_html_module_tmpl.php
CHANGED
@@ -14,7 +14,7 @@ $value = array_key_exists( 'value', $model ) ? $model['value'] : array();
|
|
14 |
if ( !function_exists( 'Nimble\sek_print_html_content') ) {
|
15 |
function sek_print_html_content( $html_content, $input_id ) {
|
16 |
if ( empty( $html_content ) ) {
|
17 |
-
echo Nimble_Manager()->sek_get_input_placeholder_content( 'text', 'html_content' );
|
18 |
} else {
|
19 |
// Feb 2021 : now saved as a json to fix emojis issues
|
20 |
// see fix for https://github.com/presscustomizr/nimble-builder/issues/544
|
@@ -36,7 +36,7 @@ if ( !function_exists( 'Nimble\sek_print_html_content') ) {
|
|
36 |
if ( !skp_is_customizing() ) {
|
37 |
$html_content = apply_filters( 'nimble_parse_for_smart_load', $html_content );
|
38 |
}
|
39 |
-
echo $html_content;
|
40 |
remove_filter( 'sek_html_content', 'do_shortcode' );
|
41 |
}
|
42 |
}
|
14 |
if ( !function_exists( 'Nimble\sek_print_html_content') ) {
|
15 |
function sek_print_html_content( $html_content, $input_id ) {
|
16 |
if ( empty( $html_content ) ) {
|
17 |
+
echo esc_html(Nimble_Manager()->sek_get_input_placeholder_content( 'text', 'html_content' ));
|
18 |
} else {
|
19 |
// Feb 2021 : now saved as a json to fix emojis issues
|
20 |
// see fix for https://github.com/presscustomizr/nimble-builder/issues/544
|
36 |
if ( !skp_is_customizing() ) {
|
37 |
$html_content = apply_filters( 'nimble_parse_for_smart_load', $html_content );
|
38 |
}
|
39 |
+
echo esc_html($html_content);
|
40 |
remove_filter( 'sek_html_content', 'do_shortcode' );
|
41 |
}
|
42 |
}
|
tmpl/modules/social_icons_tmpl.php
CHANGED
@@ -10,7 +10,7 @@ if ( !function_exists( 'Nimble\sek_print_social_links' ) ) {
|
|
10 |
// Add more protocols to be allowed as safe urls. See: https://github.com/presscustomizr/nimble-builder/issues/461:wq
|
11 |
$allowed_protocols = array_merge( (array) wp_allowed_protocols(), array( 'skype', 'callto' ) );
|
12 |
|
13 |
-
echo '<ul class="sek-social-icons-wrapper">';
|
14 |
foreach( $icons_collection as $item ) {
|
15 |
// normalize
|
16 |
$item = !is_array( $item ) ? array() : $item;
|
@@ -48,7 +48,7 @@ if ( !function_exists( 'Nimble\sek_print_social_links' ) ) {
|
|
48 |
( empty( $item['icon'] ) || !is_string( $item['icon'] ) ) ? 'social-link' : $item['icon']
|
49 |
);
|
50 |
}//foreach
|
51 |
-
echo '</ul>';
|
52 |
|
53 |
}
|
54 |
}
|
10 |
// Add more protocols to be allowed as safe urls. See: https://github.com/presscustomizr/nimble-builder/issues/461:wq
|
11 |
$allowed_protocols = array_merge( (array) wp_allowed_protocols(), array( 'skype', 'callto' ) );
|
12 |
|
13 |
+
echo esc_html('<ul class="sek-social-icons-wrapper">');
|
14 |
foreach( $icons_collection as $item ) {
|
15 |
// normalize
|
16 |
$item = !is_array( $item ) ? array() : $item;
|
48 |
( empty( $item['icon'] ) || !is_string( $item['icon'] ) ) ? 'social-link' : $item['icon']
|
49 |
);
|
50 |
}//foreach
|
51 |
+
echo esc_html('</ul>');
|
52 |
|
53 |
}
|
54 |
}
|
tmpl/modules/spacer_module_tmpl.php
CHANGED
@@ -4,4 +4,4 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
-
echo '<div class="sek-spacer"></div>';
|
4 |
exit;
|
5 |
}
|
6 |
|
7 |
+
echo esc_html('<div class="sek-spacer"></div>');
|
tmpl/modules/special_img_module_tmpl.php
CHANGED
@@ -119,4 +119,4 @@ if ( !function_exists( 'Nimble\sek_get_img_module_img_link' ) ) {
|
|
119 |
}
|
120 |
|
121 |
// Print
|
122 |
-
echo sek_get_img_module_img_html( $main_settings );
|
119 |
}
|
120 |
|
121 |
// Print
|
122 |
+
echo esc_html(sek_get_img_module_img_html( $main_settings ));
|
tmpl/modules/tinymce_editor_module_tmpl.php
CHANGED
@@ -15,7 +15,7 @@ $value = $value['main_settings'];
|
|
15 |
if ( !function_exists( 'Nimble\sek_print_tiny_mce_text_content') ) {
|
16 |
function sek_print_tiny_mce_text_content( $tiny_mce_content, $input_id, $value ) {
|
17 |
if ( empty( $tiny_mce_content ) ) {
|
18 |
-
echo Nimble_Manager()->sek_get_input_placeholder_content( 'detached_tinymce_editor', $input_id );
|
19 |
} else {
|
20 |
if ( false === sek_booleanize_checkbox_val( $value['autop'] ) ) {
|
21 |
remove_filter( 'the_nimble_tinymce_module_content', 'wpautop');
|
@@ -37,7 +37,7 @@ if ( !function_exists( 'Nimble\sek_print_tiny_mce_text_content') ) {
|
|
37 |
if ( skp_is_customizing() ) {
|
38 |
printf('<div title="%3$s" data-sek-input-type="detached_tinymce_editor" data-sek-input-id="%1$s">%2$s</div>', $input_id, $content, __( 'Click to edit', 'nimble-builder' ) );
|
39 |
} else {
|
40 |
-
echo apply_filters( 'nimble_parse_for_smart_load', $content );
|
41 |
}
|
42 |
}
|
43 |
}
|
15 |
if ( !function_exists( 'Nimble\sek_print_tiny_mce_text_content') ) {
|
16 |
function sek_print_tiny_mce_text_content( $tiny_mce_content, $input_id, $value ) {
|
17 |
if ( empty( $tiny_mce_content ) ) {
|
18 |
+
echo esc_html(Nimble_Manager()->sek_get_input_placeholder_content( 'detached_tinymce_editor', $input_id ));
|
19 |
} else {
|
20 |
if ( false === sek_booleanize_checkbox_val( $value['autop'] ) ) {
|
21 |
remove_filter( 'the_nimble_tinymce_module_content', 'wpautop');
|
37 |
if ( skp_is_customizing() ) {
|
38 |
printf('<div title="%3$s" data-sek-input-type="detached_tinymce_editor" data-sek-input-id="%1$s">%2$s</div>', $input_id, $content, __( 'Click to edit', 'nimble-builder' ) );
|
39 |
} else {
|
40 |
+
echo esc_html(apply_filters( 'nimble_parse_for_smart_load', $content ));
|
41 |
}
|
42 |
}
|
43 |
}
|