Plugin Directory

Changeset 3795677


Ignore:
Timestamp:
11/11/2026 05:11:31 AM (10 hours ago)
Author:
pransburg
Message:

PressKlip Post Tag Manager 1.0.1: More from PressKlip card

Location:
pressklip-post-tag-manager
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • pressklip-post-tag-manager/tags/1.0.1/assets/admin.css

    r3795598 r3795677  
    619619}
    620620
     621.tiertags-family {
     622        margin: 22px 0 0;
     623        padding: 14px 18px;
     624        background: var(--tt-card);
     625        border: 1px solid var(--tt-line);
     626        border-radius: 10px;
     627}
     628
     629.tiertags-family__head {
     630        display: flex;
     631        align-items: center;
     632        justify-content: space-between;
     633        gap: 12px;
     634}
     635
     636.tiertags-family h2 {
     637        margin: 0;
     638        color: var(--tt-text);
     639        font-size: 14px;
     640}
     641
     642.wp-core-ui .tiertags-family .button-link {
     643        color: var(--tt-link);
     644}
     645
     646.tiertags-family ul {
     647        margin: 10px 0 0;
     648}
     649
     650.tiertags-family li {
     651        margin: 6px 0 0;
     652        color: var(--tt-muted);
     653}
     654
     655.tiertags-family li a {
     656        margin-right: 6px;
     657        font-weight: 600;
     658}
     659
    621660.tiertags-foot {
    622661        margin: 22px 0 0;
  • pressklip-post-tag-manager/tags/1.0.1/includes/class-tiertags-admin.php

    r3795598 r3795677  
    2323        const TAB_ARG = 'tiertags_tax';
    2424
     25        /** User meta: this admin hid the "More from PressKlip" card. */
     26        const FAMILY_META = 'tiertags_family_hidden';
     27
    2528        /** @var string Hook suffix of the Tag Manager screen. */
    2629        private static $hook = '';
    … …  
    3033                add_action( 'admin_enqueue_scripts', array( __CLASS__, 'assets' ) );
    3134                add_action( 'admin_post_tiertags_settings', array( __CLASS__, 'handle_settings' ) );
     35                add_action( 'admin_post_tiertags_hide_family', array( __CLASS__, 'handle_hide_family' ) );
    3236                add_filter( 'plugin_action_links_' . plugin_basename( TIERTAGS_FILE ), array( __CLASS__, 'action_links' ) );
    3337                add_action( 'admin_init', array( __CLASS__, 'term_screens' ) );
    … …  
    257261                        <?php endif; ?>
    258262
     263                        <?php if ( $is_admin ) : ?>
     264                                <?php self::render_family( $taxonomy ); ?>
     265                        <?php endif; ?>
     266
    259267                        <p class="tiertags-foot">
    260268                                <?php esc_html_e( 'A free plugin from the PressKlip family.', 'pressklip-post-tag-manager' ); ?>
    … …  
    348356                </form>
    349357                <?php
     358        }
     359
     360        /**
     361         * The other PressKlip plugins this site does not run yet, at the bottom of
     362         * this plugin's own screen only (Phillip, 2026-11-10). WordPress.org allows
     363         * this as long as it stays here and can be turned off: never a site-wide
     364         * notice, and nothing in this plugin ever waits on a paid product.
     365         *
     366         * @param string $taxonomy Current taxonomy, to return to after hiding.
     367         */
     368        private static function render_family( $taxonomy ) {
     369                if ( get_user_meta( get_current_user_id(), self::FAMILY_META, true ) ) {
     370                        return;
     371                }
     372                $products = array();
     373                if ( ! defined( 'PK_VERSION' ) ) {
     374                        $products[] = array(
     375                                'name' => 'PressKlip Video',
     376                                'text' => __( 'Import your YouTube channel into WordPress as real posts you own, with a branded player and 11 layouts. Has a free plan.', 'pressklip-post-tag-manager' ),
     377                                'url'  => 'https://pressklip.com/video/',
     378                        );
     379                }
     380                if ( ! defined( 'PS_VERSION' ) ) {
     381                        $products[] = array(
     382                                'name' => 'PressKlip Social',
     383                                'text' => __( 'Import your own Instagram, Facebook Page and TikTok posts into WordPress as real posts you own. Has a free plan.', 'pressklip-post-tag-manager' ),
     384                                'url'  => 'https://pressklip.com/social/',
     385                        );
     386                }
     387                if ( ! $products ) {
     388                        return;
     389                }
     390                ?>
     391                <div class="tiertags-family">
     392                        <div class="tiertags-family__head">
     393                                <h2><?php esc_html_e( 'More from PressKlip', 'pressklip-post-tag-manager' ); ?></h2>
     394                                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     395                                        <input type="hidden" name="action" value="tiertags_hide_family">
     396                                        <input type="hidden" name="<?php echo esc_attr( self::TAB_ARG ); ?>" value="<?php echo esc_attr( $taxonomy ); ?>">
     397                                        <?php wp_nonce_field( 'tiertags_hide_family' ); ?>
     398                                        <button type="submit" class="button-link"><?php esc_html_e( 'Hide this', 'pressklip-post-tag-manager' ); ?></button>
     399                                </form>
     400                        </div>
     401                        <ul>
     402                                <?php foreach ( $products as $product ) : ?>
     403                                        <li>
     404                                                <a href="<?php echo esc_url( $product['url'] ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $product['name'] ); ?></a>
     405                                                <span><?php echo esc_html( $product['text'] ); ?></span>
     406                                        </li>
     407                                <?php endforeach; ?>
     408                        </ul>
     409                </div>
     410                <?php
     411        }
     412
     413        /** Per user, and for good: each admin decides for themselves. */
     414        public static function handle_hide_family() {
     415                check_admin_referer( 'tiertags_hide_family' );
     416                if ( ! current_user_can( 'manage_options' ) ) {
     417                        wp_die( esc_html__( 'You cannot change these settings.', 'pressklip-post-tag-manager' ), '', array( 'response' => 403 ) );
     418                }
     419                update_user_meta( get_current_user_id(), self::FAMILY_META, 1 );
     420                $back = isset( $_POST[ self::TAB_ARG ] ) ? sanitize_key( wp_unslash( $_POST[ self::TAB_ARG ] ) ) : '';
     421                wp_safe_redirect( self::url( array( self::TAB_ARG => $back ) ) );
     422                exit;
    350423        }
    351424
  • pressklip-post-tag-manager/tags/1.0.1/pressklip-post-tag-manager.php

    r3795598 r3795677  
    33 * Plugin Name:       PressKlip Post Tag Manager
    44 * Description:       See every tag you have, hide the ones you are done with and every post that carries them, and keep the few posts you still want showing. Nothing is deleted.
    5  * Version:           1.0.0
     5 * Version:           1.0.1
    66 * Requires at least: 6.2
    77 * Requires PHP:      7.4
    … …  
    1919}
    2020
    21 define( 'TIERTAGS_VERSION', '1.0.0' );
     21define( 'TIERTAGS_VERSION', '1.0.1' );
    2222define( 'TIERTAGS_FILE', __FILE__ );
    2323define( 'TIERTAGS_DIR', plugin_dir_path( __FILE__ ) );
  • pressklip-post-tag-manager/tags/1.0.1/readme.txt

    r3795598 r3795677  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    115115== Changelog ==
    116116
     117= 1.0.1 =
     118* Added: a small "More from PressKlip" card at the bottom of this plugin's own screen. It lists only the PressKlip plugins your site does not run, and "Hide this" removes it for good.
     119
    117120= 1.0.0 =
    118121* First release.
    … …  
    120123== Upgrade Notice ==
    121124
     125= 1.0.1 =
     126Adds a small card you can hide at the bottom of the plugin's screen. Nothing else changes.
     127
    122128= 1.0.0 =
    123129First release.
  • pressklip-post-tag-manager/tags/1.0.1/uninstall.php

    r3795598 r3795677  
    1818delete_transient( 'tiertags_hidden_ids' );
    1919delete_metadata( 'post', 0, '_tiertags_visibility', '', true );
     20delete_metadata( 'user', 0, 'tiertags_family_hidden', '', true );
    2021
    2122// Every term meta key the plugin has used (tiertags_hidden, and tiertags_tier
  • pressklip-post-tag-manager/trunk/assets/admin.css

    r3795598 r3795677  
    619619}
    620620
     621.tiertags-family {
     622        margin: 22px 0 0;
     623        padding: 14px 18px;
     624        background: var(--tt-card);
     625        border: 1px solid var(--tt-line);
     626        border-radius: 10px;
     627}
     628
     629.tiertags-family__head {
     630        display: flex;
     631        align-items: center;
     632        justify-content: space-between;
     633        gap: 12px;
     634}
     635
     636.tiertags-family h2 {
     637        margin: 0;
     638        color: var(--tt-text);
     639        font-size: 14px;
     640}
     641
     642.wp-core-ui .tiertags-family .button-link {
     643        color: var(--tt-link);
     644}
     645
     646.tiertags-family ul {
     647        margin: 10px 0 0;
     648}
     649
     650.tiertags-family li {
     651        margin: 6px 0 0;
     652        color: var(--tt-muted);
     653}
     654
     655.tiertags-family li a {
     656        margin-right: 6px;
     657        font-weight: 600;
     658}
     659
    621660.tiertags-foot {
    622661        margin: 22px 0 0;
  • pressklip-post-tag-manager/trunk/includes/class-tiertags-admin.php

    r3795598 r3795677  
    2323        const TAB_ARG = 'tiertags_tax';
    2424
     25        /** User meta: this admin hid the "More from PressKlip" card. */
     26        const FAMILY_META = 'tiertags_family_hidden';
     27
    2528        /** @var string Hook suffix of the Tag Manager screen. */
    2629        private static $hook = '';
    … …  
    3033                add_action( 'admin_enqueue_scripts', array( __CLASS__, 'assets' ) );
    3134                add_action( 'admin_post_tiertags_settings', array( __CLASS__, 'handle_settings' ) );
     35                add_action( 'admin_post_tiertags_hide_family', array( __CLASS__, 'handle_hide_family' ) );
    3236                add_filter( 'plugin_action_links_' . plugin_basename( TIERTAGS_FILE ), array( __CLASS__, 'action_links' ) );
    3337                add_action( 'admin_init', array( __CLASS__, 'term_screens' ) );
    … …  
    257261                        <?php endif; ?>
    258262
     263                        <?php if ( $is_admin ) : ?>
     264                                <?php self::render_family( $taxonomy ); ?>
     265                        <?php endif; ?>
     266
    259267                        <p class="tiertags-foot">
    260268                                <?php esc_html_e( 'A free plugin from the PressKlip family.', 'pressklip-post-tag-manager' ); ?>
    … …  
    348356                </form>
    349357                <?php
     358        }
     359
     360        /**
     361         * The other PressKlip plugins this site does not run yet, at the bottom of
     362         * this plugin's own screen only (Phillip, 2026-11-10). WordPress.org allows
     363         * this as long as it stays here and can be turned off: never a site-wide
     364         * notice, and nothing in this plugin ever waits on a paid product.
     365         *
     366         * @param string $taxonomy Current taxonomy, to return to after hiding.
     367         */
     368        private static function render_family( $taxonomy ) {
     369                if ( get_user_meta( get_current_user_id(), self::FAMILY_META, true ) ) {
     370                        return;
     371                }
     372                $products = array();
     373                if ( ! defined( 'PK_VERSION' ) ) {
     374                        $products[] = array(
     375                                'name' => 'PressKlip Video',
     376                                'text' => __( 'Import your YouTube channel into WordPress as real posts you own, with a branded player and 11 layouts. Has a free plan.', 'pressklip-post-tag-manager' ),
     377                                'url'  => 'https://pressklip.com/video/',
     378                        );
     379                }
     380                if ( ! defined( 'PS_VERSION' ) ) {
     381                        $products[] = array(
     382                                'name' => 'PressKlip Social',
     383                                'text' => __( 'Import your own Instagram, Facebook Page and TikTok posts into WordPress as real posts you own. Has a free plan.', 'pressklip-post-tag-manager' ),
     384                                'url'  => 'https://pressklip.com/social/',
     385                        );
     386                }
     387                if ( ! $products ) {
     388                        return;
     389                }
     390                ?>
     391                <div class="tiertags-family">
     392                        <div class="tiertags-family__head">
     393                                <h2><?php esc_html_e( 'More from PressKlip', 'pressklip-post-tag-manager' ); ?></h2>
     394                                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
     395                                        <input type="hidden" name="action" value="tiertags_hide_family">
     396                                        <input type="hidden" name="<?php echo esc_attr( self::TAB_ARG ); ?>" value="<?php echo esc_attr( $taxonomy ); ?>">
     397                                        <?php wp_nonce_field( 'tiertags_hide_family' ); ?>
     398                                        <button type="submit" class="button-link"><?php esc_html_e( 'Hide this', 'pressklip-post-tag-manager' ); ?></button>
     399                                </form>
     400                        </div>
     401                        <ul>
     402                                <?php foreach ( $products as $product ) : ?>
     403                                        <li>
     404                                                <a href="<?php echo esc_url( $product['url'] ); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html( $product['name'] ); ?></a>
     405                                                <span><?php echo esc_html( $product['text'] ); ?></span>
     406                                        </li>
     407                                <?php endforeach; ?>
     408                        </ul>
     409                </div>
     410                <?php
     411        }
     412
     413        /** Per user, and for good: each admin decides for themselves. */
     414        public static function handle_hide_family() {
     415                check_admin_referer( 'tiertags_hide_family' );
     416                if ( ! current_user_can( 'manage_options' ) ) {
     417                        wp_die( esc_html__( 'You cannot change these settings.', 'pressklip-post-tag-manager' ), '', array( 'response' => 403 ) );
     418                }
     419                update_user_meta( get_current_user_id(), self::FAMILY_META, 1 );
     420                $back = isset( $_POST[ self::TAB_ARG ] ) ? sanitize_key( wp_unslash( $_POST[ self::TAB_ARG ] ) ) : '';
     421                wp_safe_redirect( self::url( array( self::TAB_ARG => $back ) ) );
     422                exit;
    350423        }
    351424
  • pressklip-post-tag-manager/trunk/pressklip-post-tag-manager.php

    r3795598 r3795677  
    33 * Plugin Name:       PressKlip Post Tag Manager
    44 * Description:       See every tag you have, hide the ones you are done with and every post that carries them, and keep the few posts you still want showing. Nothing is deleted.
    5  * Version:           1.0.0
     5 * Version:           1.0.1
    66 * Requires at least: 6.2
    77 * Requires PHP:      7.4
    … …  
    1919}
    2020
    21 define( 'TIERTAGS_VERSION', '1.0.0' );
     21define( 'TIERTAGS_VERSION', '1.0.1' );
    2222define( 'TIERTAGS_FILE', __FILE__ );
    2323define( 'TIERTAGS_DIR', plugin_dir_path( __FILE__ ) );
  • pressklip-post-tag-manager/trunk/readme.txt

    r3795598 r3795677  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    115115== Changelog ==
    116116
     117= 1.0.1 =
     118* Added: a small "More from PressKlip" card at the bottom of this plugin's own screen. It lists only the PressKlip plugins your site does not run, and "Hide this" removes it for good.
     119
    117120= 1.0.0 =
    118121* First release.
    … …  
    120123== Upgrade Notice ==
    121124
     125= 1.0.1 =
     126Adds a small card you can hide at the bottom of the plugin's screen. Nothing else changes.
     127
    122128= 1.0.0 =
    123129First release.
  • pressklip-post-tag-manager/trunk/uninstall.php

    r3795598 r3795677  
    1818delete_transient( 'tiertags_hidden_ids' );
    1919delete_metadata( 'post', 0, '_tiertags_visibility', '', true );
     20delete_metadata( 'user', 0, 'tiertags_family_hidden', '', true );
    2021
    2122// Every term meta key the plugin has used (tiertags_hidden, and tiertags_tier
Note: See TracChangeset for help on using the changeset viewer.