Skip to content

Commit

Permalink
Update notices with link to use Migrate PHP component
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Oct 3, 2024
1 parent dc72c71 commit cc321eb
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 20 deletions.
62 changes: 48 additions & 14 deletions components/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,17 @@ public function register_config() {
'name' => 'code_php_notice',
'type' => 'html',
'html_content' => sprintf(
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
'
<div class="pods-ui-notice-admin pods-ui-notice-warning">
<p>⚠️&nbsp;&nbsp;%1$s</p>
<p><a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a> | <a href="%4$s" target="_blank" rel="noopener noreferrer">%5$s</a></p>
</div>
',
esc_html__( 'PHP detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'wildcard-on' => [
'code' => [
Expand All @@ -233,10 +240,17 @@ public function register_config() {
'name' => 'precode_notice',
'type' => 'html',
'html_content' => sprintf(
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
'
<div class="pods-ui-notice-admin pods-ui-notice-warning">
<p>⚠️&nbsp;&nbsp;%1$s</p>
<p><a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a> | <a href="%4$s" target="_blank" rel="noopener noreferrer">%5$s</a></p>
</div>
',
esc_html__( 'Precode detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'excludes-on' => [
'precode' => '',
Expand Down Expand Up @@ -695,11 +709,16 @@ public function edit_page_form() {
if ( PODS_DISABLE_EVAL ) {
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
__( 'Pod Page Error', 'pods' ),
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
esc_html__( 'Pod Page Error', 'pods' ),
esc_html__( 'This Pod Page contains PHP code that will not run due to security restrictions in Pods. To enable PHP code, you must configure your website to allow PHP by setting the constant PODS_DISABLE_EVAL to false.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'error',
false,
Expand All @@ -708,11 +727,16 @@ public function edit_page_form() {
} else {
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
__( 'Pod Page Warning', 'pods' ),
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
esc_html__( 'Pod Page Warning', 'pods' ),
esc_html__( 'This Pod Page contains PHP code that will no longer run in Pods 3.3+.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'warning'
);
Expand All @@ -725,11 +749,16 @@ public function edit_page_form() {
if ( PODS_DISABLE_EVAL ) {
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
__( 'Pod Page Error', 'pods' ),
__( 'This Pod Page contains precode (deprecated) that will not run due to security restrictions in Pods. To enable PHP code, you must configure your website to allow PHP by setting the constant PODS_DISABLE_EVAL to false.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'error',
false,
Expand All @@ -738,11 +767,16 @@ public function edit_page_form() {
} else {
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
__( 'Pod Page Warning', 'pods' ),
__( 'This Pod Page contains precode which is deprecated -- it will no longer run in Pods 3.3+.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/',
__( 'Switch to file-based Pod Pages', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'warning'
);
Expand Down
29 changes: 23 additions & 6 deletions components/Templates/includes/element-view_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,34 @@
pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' );

printf(
'<div class="pods-ui-notice-admin pods-ui-notice-warning"><p>⚠️&nbsp;&nbsp;%1s - <a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a></p></div>',
'
<div class="pods-ui-notice-admin pods-ui-notice-warning">
<p>⚠️&nbsp;&nbsp;%1$s</p>
<p><a href="%2$s" target="_blank" rel="noopener noreferrer">%3$s</a> | <a href="%4$s" target="_blank" rel="noopener noreferrer">%5$s</a></p>
</div>
',
esc_html__( 'PHP detected, this feature is deprecated', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Templates', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Templates using our Migrate PHP into File-based templates component', 'pods' )
);
?>

<?php if ( PODS_DISABLE_EVAL ) : ?>
<?php
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
esc_html__( 'Pod Template Error', 'pods' ),
esc_html__( 'This template contains PHP code that will not run due to security restrictions in Pods. To enable PHP code, you must configure your website to allow PHP by setting the constant PODS_DISABLE_EVAL to false.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Templates', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Templates using our Migrate PHP into File-based templates component', 'pods' )
),
'error',
false,
Expand All @@ -52,11 +64,16 @@
<?php
pods_message(
sprintf(
'<p><strong>%1$s:</strong> %2$s</p><p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a></p>',
'
<p><strong>%1$s:</strong> %2$s</p>
<p><a href="%3$s" target="_blank" rel="noopener noreferrer">%4$s</a> | <a href="%5$s" target="_blank" rel="noopener noreferrer">%6$s</a></p>
',
esc_html__( 'Pod Template Warning', 'pods' ),
esc_html__( 'This template contains PHP code that will no longer run in Pods 3.3+.', 'pods' ),
'https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/',
esc_html__( 'Switch to file-based Pod Templates', 'pods' )
esc_html__( 'Read more about file-based templates', 'pods' ),
admin_url( 'admin.php?page=pods-components' ),
esc_html__( 'Switch to file-based Pod Pages using our Migrate PHP into File-based templates component', 'pods' )
),
'warning'
);
Expand Down

0 comments on commit cc321eb

Please sign in to comment.