PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / trunk
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant vtrunk
2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 All 59 releases
merchant / admin / classes / admin-options / fields / create-page / template.php

template.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant trunk, at admin/classes/admin-options/fields/create-page/template.php

68 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template: Create Page field.
4 *
5 * @var array<string, mixed> $settings Field configuration.
6 * @var mixed $value Current saved value.
7 * @var string $module_id Module ID.
8 *
9 * @package Merchant
10 * @since 2.2.5
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 $page_id = get_option( $settings['option_name'] );
18
19 echo '<div class="merchant-create-page-control">';
20
21 if ( $page_id && post_exists( get_the_title( $page_id ) ) && 'publish' === get_post_status( $page_id ) ) {
22 echo wp_kses_post(
23 sprintf( /* translators: 1: link to edit page */
24 __( '<p class="merchant-module-page-setting-field-desc mrc-mt-0">Your page is created!</p><p class="merchant-module-page-setting-field-desc">Click <a href="%1$s" target="_blank">here</a> if you want to edit the page.</p><p class="merchant-module-page-setting-field-desc mrc-mb-0">To display the page in your theme header area, assign the page to the primary menu by clicking <a href="%2$s" target="_blank">here</a></p>',
25 'merchant' ),
26 get_admin_url() . 'post.php?post=' . $page_id . '&action=edit',
27 get_admin_url() . 'nav-menus.php'
28 )
29 );
30 } else {
31 echo '<div class="merchant-create-page-control-create-message">';
32 echo wp_kses_post(
33 '<p class="merchant-module-page-setting-field-desc mrc-mt-0">'.
34 sprintf( /* translators: 1: page name */
35 __( 'It looks like you haven\'t created a <strong>%1$s</strong> page yet. Click the below button to create the page.',
36 'merchant' ),
37 $settings['page_title']
38 ). '</p>'
39 );
40 echo '</div>';
41 echo '<div class="merchant-create-page-control-success-message" style="display: none;">';
42 echo wp_kses_post(
43 sprintf( /* translators: 1: link to edit page */
44 __( '<p class="merchant-module-page-setting-field-desc">Page created with success!</p><p class="merchant-module-page-setting-field-desc">Click <a href="%1$s" target="_blank">here</a> if you want to edit the page.</p><p class="merchant-module-page-setting-field-desc mrc-mb-0">To display the page in your theme header area, assign the page to the primary menu by clicking <a href="%2$s" target="_blank">here</a></p>',
45 'merchant' ),
46 get_admin_url() . 'post.php?post=&action=edit',
47 get_admin_url() . 'nav-menus.php'
48 )
49 );
50 echo '</div>';
51 echo wp_kses_post(
52 sprintf( /* translators: 1: page title, 2: page meta key, 3: page meta value, 4: option name, 5: nonce, 6: loading text, 7: success text */
53 __( '<a href="#" class="merchant-create-page-control-button button-tertiary" data-page-title="%2$s" data-page-meta-key="%3$s" data-page-meta-value="%4$s" data-option-name="%5$s" data-nonce="%6$s" data-creating-text="%7$s" data-created-text="%8$s">%1$s</a>',
54 'merchant' ),
55 __( 'Create Page', 'merchant' ),
56 $settings['page_title'],
57 $settings['page_meta_key'],
58 $settings['page_meta_value'],
59 $settings['option_name'],
60 wp_create_nonce( 'customize-create-page-control-nonce' ),
61 __( 'Creating...', 'merchant' ),
62 __( 'Created!', 'merchant' )
63 )
64 );
65 }
66
67 echo '</div>';
68