Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/royal-el.../admin
File: theme-builder.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit; // Exit if accessed directly.
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
use WprAddons\Admin\Includes\WPR_Templates_Loop;
[6] Fix | Delete
use WprAddons\Classes\Utilities;
[7] Fix | Delete
[8] Fix | Delete
// Register Menus
[9] Fix | Delete
function wpr_addons_add_theme_builder_menu() {
[10] Fix | Delete
add_submenu_page( 'wpr-addons', 'Theme Builder', 'Theme Builder', 'manage_options', 'wpr-theme-builder', 'wpr_addons_theme_builder_page' );
[11] Fix | Delete
}
[12] Fix | Delete
add_action( 'admin_menu', 'wpr_addons_add_theme_builder_menu' );
[13] Fix | Delete
[14] Fix | Delete
function wpr_addons_theme_builder_page() {
[15] Fix | Delete
[16] Fix | Delete
?>
[17] Fix | Delete
[18] Fix | Delete
<div class="wrap wpr-settings-page-wrap">
[19] Fix | Delete
[20] Fix | Delete
<div class="wpr-settings-page-header">
[21] Fix | Delete
<h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
[22] Fix | Delete
[23] Fix | Delete
<p><?php esc_html_e( 'The most powerful Elementor Addon in the universe.', 'wpr-addons' ); ?></p>
[24] Fix | Delete
<!-- <a href="https://royaladdons.frill.co/b/6m4d5qm4/feature-ideas" class="" target="_blank" style="padding: 8px 22px;">
[25] Fix | Delete
<?php echo esc_html__( 'Request New Feature', 'wpr-addons' ); ?>
[26] Fix | Delete
</a> -->
[27] Fix | Delete
[28] Fix | Delete
<!-- Custom Template -->
[29] Fix | Delete
<div class="wpr-preview-buttons">
[30] Fix | Delete
<div class="wpr-user-template">
[31] Fix | Delete
<span><?php esc_html_e( 'Create Template', 'wpr-addons' ); ?></span>
[32] Fix | Delete
<span class="plus-icon">+</span>
[33] Fix | Delete
[34] Fix | Delete
<?php
[35] Fix | Delete
if ( ! class_exists( 'WooCommerce' ) && isset($_GET['tab']) && ('wpr_tab_product_archive' === $_GET['tab'] || 'wpr_tab_product_single' === $_GET['tab'] )) {
[36] Fix | Delete
echo '<div></div>';
[37] Fix | Delete
}
[38] Fix | Delete
?>
[39] Fix | Delete
</div>
[40] Fix | Delete
[41] Fix | Delete
<a href="https://www.youtube.com/watch?v=kE1zmi3fxh8" class="wpr-dynamic-tutorial wpr-options-button button" target="_blank" style="padding: 8px 22px;">
[42] Fix | Delete
<?php echo esc_html__( 'Dynamic Websites Tutorial', 'wpr-addons' ); ?>
[43] Fix | Delete
<span class="dashicons dashicons-video-alt3"></span>
[44] Fix | Delete
</a>
[45] Fix | Delete
[46] Fix | Delete
<a href="https://www.youtube.com/watch?v=f_3tNiBC3dw" class="wpr-how-to-use-woo-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
[47] Fix | Delete
<?php echo esc_html__( 'WooCommerce Builder Tutorial', 'wpr-addons' ); ?>
[48] Fix | Delete
<span class="dashicons dashicons-video-alt3"></span>
[49] Fix | Delete
</a>
[50] Fix | Delete
[51] Fix | Delete
<a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-how-to-use-theme-builder wpr-options-button button" target="_blank" style="padding: 8px 22px; margin-left: 10px;">
[52] Fix | Delete
<?php echo esc_html__( 'Theme Builder Tutorial', 'wpr-addons' ); ?>
[53] Fix | Delete
<span class="dashicons dashicons-video-alt3"></span>
[54] Fix | Delete
</a>
[55] Fix | Delete
</div>
[56] Fix | Delete
</div>
[57] Fix | Delete
[58] Fix | Delete
<div class="wpr-settings-page">
[59] Fix | Delete
<form method="post" action="options.php">
[60] Fix | Delete
<?php
[61] Fix | Delete
[62] Fix | Delete
// Active Tab
[63] Fix | Delete
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
[64] Fix | Delete
[65] Fix | Delete
?>
[66] Fix | Delete
[67] Fix | Delete
<!-- Template ID Holder -->
[68] Fix | Delete
<input type="hidden" name="wpr_template" id="wpr_template" value="">
[69] Fix | Delete
[70] Fix | Delete
<!-- Conditions Popup -->
[71] Fix | Delete
<?php WPR_Templates_Loop::render_conditions_popup(true); ?>
[72] Fix | Delete
[73] Fix | Delete
<!-- Create Templte Popup -->
[74] Fix | Delete
<?php WPR_Templates_Loop::render_create_template_popup(); ?>
[75] Fix | Delete
[76] Fix | Delete
<!-- Tabs -->
[77] Fix | Delete
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
[78] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_header" data-title="Header" class="nav-tab <?php echo ($active_tab == 'wpr_tab_header') ? 'nav-tab-active' : ''; ?>">
[79] Fix | Delete
<?php esc_html_e( 'Header', 'wpr-addons' ); ?>
[80] Fix | Delete
</a>
[81] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_footer" data-title="Footer" class="nav-tab <?php echo ($active_tab == 'wpr_tab_footer') ? 'nav-tab-active' : ''; ?>">
[82] Fix | Delete
<?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
[83] Fix | Delete
</a>
[84] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_archive" data-title="Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_archive') ? 'nav-tab-active' : ''; ?>">
[85] Fix | Delete
<?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
[86] Fix | Delete
</a>
[87] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_single" data-title="Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_single') ? 'nav-tab-active' : ''; ?>">
[88] Fix | Delete
<?php esc_html_e( 'Single', 'wpr-addons' ); ?>
[89] Fix | Delete
</a>
[90] Fix | Delete
[91] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_product_archive" data-title="Product Archive" class="nav-tab <?php echo $active_tab == 'wpr_tab_product_archive' ? 'nav-tab-active' : ''; ?>">
[92] Fix | Delete
<?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
[93] Fix | Delete
</a>
[94] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_product_single" data-title="Product Single" class="nav-tab <?php echo $active_tab == 'wpr_tab_product_single' ? 'nav-tab-active' : ''; ?>">
[95] Fix | Delete
<?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
[96] Fix | Delete
</a>
[97] Fix | Delete
[98] Fix | Delete
<a href="?page=wpr-theme-builder&tab=wpr_tab_my_templates" data-title="My Templates" class="nav-tab <?php echo ($active_tab == 'wpr_tab_my_templates') ? 'nav-tab-active' : ''; ?>">
[99] Fix | Delete
<?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
[100] Fix | Delete
</a>
[101] Fix | Delete
</div>
[102] Fix | Delete
[103] Fix | Delete
[104] Fix | Delete
<?php
[105] Fix | Delete
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
[106] Fix | Delete
$url = '';
[107] Fix | Delete
if ( 'wpr_tab_my_templates' === $active_tab ) {
[108] Fix | Delete
$url = admin_url( 'edit.php?post_type=elementor_library&tabs_group=library' );
[109] Fix | Delete
} else {
[110] Fix | Delete
$url = admin_url( 'edit.php?s&post_status=all&post_type=wpr_templates&wpr_template_type='. str_replace("wpr_tab_", "", $active_tab) .'&filter_action=Filter' );
[111] Fix | Delete
}
[112] Fix | Delete
echo '<a href="' . esc_url( $url ) . '" class="button button-primary wpr-translate-templates wpr-options-button"><span class="dashicons dashicons-admin-site"></span><span>Translate WPML Templates</span></a>';
[113] Fix | Delete
echo '<a href="https://www.youtube.com/watch?v=y7yjItsMBmw" class="button button-primary wpr-translate-templates wpr-options-button tutorial">'. esc_html__("Video Tutorial") .'</a>';
[114] Fix | Delete
} else if ( is_plugin_active('polylang/polylang.php') ) {
[115] Fix | Delete
$url = '';
[116] Fix | Delete
if ( 'wpr_tab_my_templates' === $active_tab ) {
[117] Fix | Delete
$url = admin_url( 'edit.php?post_type=elementor_library&tabs_group=library' );
[118] Fix | Delete
} else {
[119] Fix | Delete
$url = admin_url( 'edit.php?s&post_status=all&post_type=wpr_templates&wpr_template_type='. str_replace("wpr_tab_", "", $active_tab) .'&filter_action=Filter' );
[120] Fix | Delete
}
[121] Fix | Delete
echo '<a href="' . esc_url( $url ) . '" class="button button-primary wpr-translate-templates wpr-options-button"><span class="dashicons dashicons-admin-site"></span><span>Translate POLYLANG Templates</span></a>';
[122] Fix | Delete
echo '<a href="https://www.youtube.com/watch?v=y7yjItsMBmw" class="button button-primary wpr-translate-templates wpr-options-button tutorial">'. esc_html__("Video Tutorial") .'</a>';
[123] Fix | Delete
}
[124] Fix | Delete
?>
[125] Fix | Delete
<?php if ( $active_tab == 'wpr_tab_header' ) : ?>
[126] Fix | Delete
[127] Fix | Delete
<!-- Save Conditions -->
[128] Fix | Delete
<input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
[129] Fix | Delete
[130] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
[131] Fix | Delete
[132] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
[133] Fix | Delete
[134] Fix | Delete
<!-- Save Conditions -->
[135] Fix | Delete
<input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
[136] Fix | Delete
[137] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
[138] Fix | Delete
[139] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
[140] Fix | Delete
[141] Fix | Delete
<!-- Save Conditions -->
[142] Fix | Delete
<input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
[143] Fix | Delete
[144] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
[145] Fix | Delete
[146] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
[147] Fix | Delete
[148] Fix | Delete
<!-- Save Conditions -->
[149] Fix | Delete
<input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
[150] Fix | Delete
[151] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
[152] Fix | Delete
[153] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_product_archive' ) : ?>
[154] Fix | Delete
[155] Fix | Delete
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
[156] Fix | Delete
<!-- Save Conditions -->
[157] Fix | Delete
<input type="hidden" name="wpr_product_archive_conditions" id="wpr_product_archive_conditions" value="<?php echo esc_attr(get_option('wpr_product_archive_conditions', '[]')); ?>">
[158] Fix | Delete
[159] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'product_archive' ); ?>
[160] Fix | Delete
<?php else : ?>
[161] Fix | Delete
<div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product archive templates!</div>
[162] Fix | Delete
<?php endif; ?>
[163] Fix | Delete
[164] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_product_single' ) : ?>
[165] Fix | Delete
[166] Fix | Delete
<?php if ( class_exists( 'WooCommerce' ) ) : ?>
[167] Fix | Delete
<!-- Save Conditions -->
[168] Fix | Delete
<input type="hidden" name="wpr_product_single_conditions" id="wpr_product_single_conditions" value="<?php echo esc_attr(get_option('wpr_product_single_conditions', '[]')); ?>">
[169] Fix | Delete
[170] Fix | Delete
<?php WPR_Templates_Loop::render_theme_builder_templates( 'product_single' ); ?>
[171] Fix | Delete
<?php else : ?>
[172] Fix | Delete
<div class="wpr-activate-woo-notice"><span class="dashicons dashicons-info-outline"></span> Please install/activate WooCommerce in order to create product single templates!</div>
[173] Fix | Delete
<?php endif ; ?>
[174] Fix | Delete
[175] Fix | Delete
<?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
[176] Fix | Delete
[177] Fix | Delete
<?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
[178] Fix | Delete
[179] Fix | Delete
<?php endif; ?>
[180] Fix | Delete
[181] Fix | Delete
</form>
[182] Fix | Delete
</div>
[183] Fix | Delete
[184] Fix | Delete
</div>
[185] Fix | Delete
[186] Fix | Delete
[187] Fix | Delete
<?php
[188] Fix | Delete
[189] Fix | Delete
} // End wpr_addons_theme_builder_page()
[190] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function