tools-sections
3 years ago
about.php
3 years ago
listings.php
3 years ago
post-types.php
3 years ago
support.php
3 years ago
taxonomies.php
3 years ago
tools.php
3 years ago
utility.php
3 years ago
wp-cli.php
3 years ago
about.php
193 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Custom Post Type UI About Page. |
| 4 | * |
| 5 | * @package CPTUI |
| 6 | * @subpackage About |
| 7 | * @author WebDevStudios |
| 8 | * @since 1.3.0 |
| 9 | * @license GPL-2.0+ |
| 10 | */ |
| 11 | |
| 12 | // phpcs:disable WebDevStudios.All.RequireAuthor |
| 13 | |
| 14 | // Exit if accessed directly. |
| 15 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | exit; |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Enqueue our Custom Post Type UI assets. |
| 21 | * |
| 22 | * @since 1.6.0 |
| 23 | */ |
| 24 | function cptui_about_assets() { |
| 25 | $current_screen = get_current_screen(); |
| 26 | |
| 27 | if ( ! is_object( $current_screen ) || 'toplevel_page_cptui_main_menu' !== $current_screen->base ) { |
| 28 | return; |
| 29 | } |
| 30 | |
| 31 | if ( wp_doing_ajax() ) { |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | wp_enqueue_style( 'cptui-css' ); |
| 36 | } |
| 37 | add_action( 'admin_enqueue_scripts', 'cptui_about_assets' ); |
| 38 | |
| 39 | /** |
| 40 | * Display our primary menu page. |
| 41 | * |
| 42 | * @since 0.3.0 |
| 43 | * |
| 44 | * @internal |
| 45 | */ |
| 46 | function cptui_settings() { |
| 47 | ?> |
| 48 | <div class="wrap about-wrap"> |
| 49 | <?php |
| 50 | |
| 51 | /** |
| 52 | * Fires inside and at the top of the wrapper for the main plugin landing page. |
| 53 | * |
| 54 | * @since 1.0.0 |
| 55 | */ |
| 56 | do_action( 'cptui_main_page_start' ); |
| 57 | ?> |
| 58 | <h1><?php esc_html_e( 'Custom Post Type UI', 'custom-post-type-ui' ); ?> <?php echo esc_html( CPTUI_VERSION ); ?></h1> |
| 59 | |
| 60 | <?php |
| 61 | |
| 62 | /** |
| 63 | * Fires after the main page `<h1>` heading tag. |
| 64 | * |
| 65 | * @since 1.3.0 |
| 66 | */ |
| 67 | do_action( 'cptui_main_page_after_header' ); |
| 68 | ?> |
| 69 | <div class="cptui-intro-devblock"> |
| 70 | <p class="about-text cptui-about-text"> |
| 71 | <?php esc_html_e( 'Thank you for choosing Custom Post Type UI! We hope that your experience with our plugin makes creating post types and taxonomies and organizing your content quick and easy.', 'custom-post-type-ui' ); ?> |
| 72 | </p> |
| 73 | <div class="cptui-badge"></div> |
| 74 | </div> |
| 75 | <?php |
| 76 | /** |
| 77 | * Fires before the About Page changelog. |
| 78 | * |
| 79 | * @since 1.4.0 |
| 80 | */ |
| 81 | do_action( 'cptui_main_page_before_changelog' ); |
| 82 | ?> |
| 83 | |
| 84 | <h2> |
| 85 | <?php |
| 86 | printf( |
| 87 | // translators: Placeholder will hold the plugin version. |
| 88 | esc_html__( "What's new in version %s", 'custom-post-type-ui' ), |
| 89 | esc_html( CPTUI_VERSION ) |
| 90 | ); |
| 91 | ?> |
| 92 | </h2> |
| 93 | <div class="changelog about-integrations"> |
| 94 | <div class="cptui-feature feature-section col three-col"> |
| 95 | <div class="col"> |
| 96 | <h2><?php esc_html_e( 'Post type descriptions', 'custom-post-type-ui' ); ?></h2> |
| 97 | <p><?php esc_html_e( 'We have updated a number of details around the post type description field. First we addressed issues with the Tools area when descriptions included quotes. Second we fixed an issue around stripping HTML from the field from previous security updates.', 'custom-post-type-ui' ); ?></p> |
| 98 | <h2><?php esc_html_e( 'Miscellaneous code cleanup and separation.', 'custom-post-type-ui' ); ?></h2> |
| 99 | <p><?php esc_html_e( 'Largely under the hood, but we have done some separation of our code and done more to help ensure code quality.', 'custom-post-type-ui' ); ?></p> |
| 100 | <h2><?php esc_html_e( 'Branding.', 'custom-post-type-ui' ); ?></h2> |
| 101 | <p><?php esc_html_e( 'We updated our branding for the plugin. Both within our UI but also on WordPress.org', 'custom-post-type-ui' ); ?></p> |
| 102 | <h2><?php esc_html_e( 'Miscellaneous.', 'custom-post-type-ui' ); ?></h2> |
| 103 | <p><?php esc_html_e( 'Added notes about some post type features also needing theme support declared for them to work. Fixed a pluralization issue with our UI and forms.', 'custom-post-type-ui' ); ?></p> |
| 104 | </div> |
| 105 | </div> |
| 106 | </div> |
| 107 | |
| 108 | <div class="extranotes"> |
| 109 | <?php |
| 110 | |
| 111 | /** |
| 112 | * Fires inside a div for extra notes. |
| 113 | * |
| 114 | * @since 1.3.0 |
| 115 | */ |
| 116 | do_action( 'cptui_main_page_extra_notes' ); |
| 117 | ?> |
| 118 | </div> |
| 119 | </div> |
| 120 | <?php |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Display Pluginize-based content. |
| 125 | * |
| 126 | * @since 1.4.0 |
| 127 | */ |
| 128 | function cptui_pluginize_content() { |
| 129 | // translators: Placeholder will hold the name of the author of the plugin. |
| 130 | echo '<h1>' . sprintf( esc_html__( 'More from %s', 'custom-post-type-ui' ), 'WebDevStudios' ) . '</h1>'; |
| 131 | echo '<div class="wdspromos-about">'; |
| 132 | $ads = cptui_get_ads(); |
| 133 | if ( ! empty( $ads ) ) { |
| 134 | |
| 135 | foreach ( $ads as $ad ) { |
| 136 | |
| 137 | $the_ad = sprintf( |
| 138 | '<img src="%s" alt="%s">', |
| 139 | esc_attr( $ad['image'] ), |
| 140 | esc_attr( $ad['text'] ) |
| 141 | ); |
| 142 | |
| 143 | // Escaping $the_ad breaks the html. |
| 144 | printf( |
| 145 | '<p><a href="%s">%s</a></p>', |
| 146 | esc_url( $ad['url'] ), |
| 147 | $the_ad // phpcs:ignore |
| 148 | ); |
| 149 | } |
| 150 | } |
| 151 | echo '</div>'; |
| 152 | } |
| 153 | add_action( 'cptui_main_page_extra_notes', 'cptui_pluginize_content', 9 ); |
| 154 | |
| 155 | /** |
| 156 | * Render our newsletter form for the about page. |
| 157 | * |
| 158 | * @since 1.4.0 |
| 159 | */ |
| 160 | function cptui_about_page_newsletter() { |
| 161 | |
| 162 | if ( cptui_is_new_install() ) { |
| 163 | return ''; |
| 164 | } |
| 165 | |
| 166 | ?> |
| 167 | <div class='wdsoctosignup'> |
| 168 | <?php |
| 169 | cptui_newsletter_form(); |
| 170 | ?> |
| 171 | </div> |
| 172 | |
| 173 | <?php |
| 174 | |
| 175 | return ''; |
| 176 | } |
| 177 | add_action( 'cptui_main_page_before_changelog', 'cptui_about_page_newsletter' ); |
| 178 | |
| 179 | /** |
| 180 | * Marks site as not new at the end of the about/main page. |
| 181 | * |
| 182 | * Can't be done on activation or else cptui_is_new_install() will immediately start |
| 183 | * returning false. So we'll do it at the end of the redirected landing page. |
| 184 | * |
| 185 | * @since 1.5.0 |
| 186 | */ |
| 187 | function cptui_mark_not_new() { |
| 188 | if ( cptui_is_new_install() ) { |
| 189 | cptui_set_not_new_install(); |
| 190 | } |
| 191 | } |
| 192 | add_action( 'cptui_main_page_extra_notes', 'cptui_mark_not_new', 999 ); |
| 193 |