about.php
5 years ago
listings.php
5 years ago
post-types.php
5 years ago
support.php
5 years ago
taxonomies.php
5 years ago
tools.php
5 years ago
utility.php
5 years ago
wp-cli.php
5 years ago
about.php
186 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><?php printf( esc_html__( "What's new in version %s", 'custom-post-type-ui' ), CPTUI_VERSION ); ?></h2> |
| 85 | <div class="changelog about-integrations"> |
| 86 | <div class="cptui-feature feature-section col three-col"> |
| 87 | <div class="col"> |
| 88 | <h2><?php esc_html_e( 'Ability to temporarily disable content types without deleting them.', 'custom-post-type-ui' ); ?></h2> |
| 89 | <p><?php esc_html_e( 'Have you ever wanted to temporarily disable things without removing their settings, as you continue developing the site? Custom Post Type UI now has the ability to skip content types with a WordPress filter. UI options to toggle will be in a later version.', 'custom-post-type-ui' ); ?></p> |
| 90 | </div> |
| 91 | <div class="col"> |
| 92 | <h2><?php esc_html_e( 'New post type labels introduced in WordPress 5.0', 'custom-post-type-ui' ); ?></h2> |
| 93 | <p><?php esc_html_e( 'We have increased our minimum supported WordPress version and with that, we now support the newest available label options. You now have even finer control over your admin UI wording.', 'custom-post-type-ui' ); ?></p> |
| 94 | </div> |
| 95 | <div class="col last-feature"> |
| 96 | <h2></h2> |
| 97 | <p></p> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | |
| 102 | <div class="extranotes"> |
| 103 | <?php |
| 104 | |
| 105 | /** |
| 106 | * Fires inside a div for extra notes. |
| 107 | * |
| 108 | * @since 1.3.0 |
| 109 | */ |
| 110 | do_action( 'cptui_main_page_extra_notes' ); |
| 111 | ?> |
| 112 | </div> |
| 113 | </div> |
| 114 | <?php |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Display Pluginize-based content. |
| 119 | * |
| 120 | * @since 1.4.0 |
| 121 | */ |
| 122 | function cptui_pluginize_content() { |
| 123 | echo '<h1>' . sprintf( esc_html__( 'More from %s', 'custom-post-type-ui' ), 'WebDevStudios' ) . '</h1>'; |
| 124 | echo '<div class="wdspromos-about">'; |
| 125 | $ads = cptui_get_ads(); |
| 126 | if ( ! empty( $ads ) ) { |
| 127 | |
| 128 | foreach ( $ads as $ad ) { |
| 129 | |
| 130 | $the_ad = sprintf( |
| 131 | '<img src="%s" alt="%s">', |
| 132 | esc_attr( $ad['image'] ), |
| 133 | esc_attr( $ad['text'] ) |
| 134 | ); |
| 135 | |
| 136 | // Escaping $the_ad breaks the html. |
| 137 | printf( |
| 138 | '<p><a href="%s">%s</a></p>', |
| 139 | esc_url( $ad['url'] ), |
| 140 | $the_ad |
| 141 | ); |
| 142 | } |
| 143 | } |
| 144 | echo '</div>'; |
| 145 | } |
| 146 | add_action( 'cptui_main_page_extra_notes', 'cptui_pluginize_content', 9 ); |
| 147 | |
| 148 | /** |
| 149 | * Render our newsletter form for the about page. |
| 150 | * |
| 151 | * @since 1.4.0 |
| 152 | */ |
| 153 | function cptui_about_page_newsletter() { |
| 154 | |
| 155 | if ( cptui_is_new_install() ) { |
| 156 | return ''; |
| 157 | } |
| 158 | |
| 159 | ?> |
| 160 | <div class='wdsoctosignup'> |
| 161 | <?php |
| 162 | cptui_newsletter_form(); |
| 163 | ?> |
| 164 | </div> |
| 165 | |
| 166 | <?php |
| 167 | |
| 168 | return ''; |
| 169 | } |
| 170 | add_action( 'cptui_main_page_before_changelog', 'cptui_about_page_newsletter' ); |
| 171 | |
| 172 | /** |
| 173 | * Marks site as not new at the end of the about/main page. |
| 174 | * |
| 175 | * Can't be done on activation or else cptui_is_new_install() will immediately start |
| 176 | * returning false. So we'll do it at the end of the redirected landing page. |
| 177 | * |
| 178 | * @since 1.5.0 |
| 179 | */ |
| 180 | function cptui_mark_not_new() { |
| 181 | if ( cptui_is_new_install() ) { |
| 182 | cptui_set_not_new_install(); |
| 183 | } |
| 184 | } |
| 185 | add_action( 'cptui_main_page_extra_notes', 'cptui_mark_not_new', 999 ); |
| 186 |