Plugin Directory

Changeset 2966107


Ignore:
Timestamp:
09/12/2023 10:53:54 PM (3 years ago)
Author:
happyprime
Message:

Update to version 1.1.0 from GitHub

Location:
shadow-terms
Files:
4 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • shadow-terms/tags/1.1.0/LICENSE

    r2825530 r2966107  
    11Shadow Terms plugin for WordPress
    22
    3 Copyright 2022 by Happy Prime and contributors
     3Copyright 2022-2023 by Happy Prime and contributors
    44
    55This program is free software; you can redistribute it and/or modify
     
    362362
    363363The source code for any program binaries or compressed scripts that are
    364 included with Turn Comments Off can be freely obtained at the following URL:
     364included with Shadow Terms can be freely obtained at the following URL:
    365365
    366366    https://github.com/happyprime/shadow-terms/
  • shadow-terms/tags/1.1.0/includes/api.php

    r2825530 r2966107  
    1616 * @return string The shadow taxonomy slug. Empty if not found.
    1717 */
    18 function get_taxonomy_slug( int $post_id ) : string {
     18function get_taxonomy_slug( int $post_id ): string {
    1919    $post = get_post( $post_id );
    2020
     
    4040 * @return int The term ID. 0 if not available.
    4141 */
    42 function get_term_id( int $post_id ) : int {
     42function get_term_id( int $post_id ): int {
    4343    $post = get_post( $post_id );
    4444
     
    7070 * @return int The post ID. 0 if not found.
    7171 */
    72 function get_post_id( int $term_id ) : int {
     72function get_post_id( int $term_id ): int {
    7373    $term = get_term( $term_id );
    7474
     
    108108 *               the shadow taxonomy.
    109109 */
    110 function get_connected_post_types( string $post_type ) : array {
     110function get_connected_post_types( string $post_type ): array {
    111111    $supports = get_all_post_type_supports( $post_type );
    112112
  • shadow-terms/tags/1.1.0/includes/sync.php

    r2914474 r2966107  
    2222 * @param null|\WP_Post $post_before The post object before the update.
    2323 */
    24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ) : void {
     24function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ): void {
    2525    // The post before object may be null for new posts, so juggle that
    2626    // possibility to capture status and title before doing anything else.
     
    103103 * @param \WP_Post $post    The post object.
    104104 */
    105 function delete_term( int $post_id, \WP_Post $post ) : void {
     105function delete_term( int $post_id, \WP_Post $post ): void {
    106106    if ( ! post_type_supports( $post->post_type, 'shadow-terms' ) ) {
    107107        return;
  • shadow-terms/tags/1.1.0/includes/taxonomy.php

    r2825530 r2966107  
    2323 * @since 1.0.0
    2424 */
    25 function register() : void {
     25function register(): void {
    2626    $post_types = get_post_types_by_support( 'shadow-terms' );
    2727
     
    3636 * @since 1.0.0
    3737 */
    38 function register_route() : void {
     38function register_route(): void {
    3939    // Register a REST route used to associate posts with a post's shadow term.
    4040    register_rest_route(
     
    5757 *                          be registered.
    5858 */
    59 function register_taxonomy( string $post_type ) : void {
     59function register_taxonomy( string $post_type ): void {
    6060    $post_type_object = get_post_type_object( $post_type );
    6161
     
    7575    );
    7676
     77    /**
     78     * Filter the arguments used to register a shadow taxonomy.
     79     *
     80     * @since 1.1.0
     81     *
     82     * @param array  $args      The arguments used to register the taxonomy.
     83     * @param string $post_type The post type this taxonomy is shadowing.
     84     */
     85    $args = apply_filters( 'shadow_terms_register_taxonomy_args', $args, $post_type );
     86
    7787    \register_taxonomy(
    7888        $post_type . '_connect',
     
    8999 * @return bool True if capable. False if not.
    90100 */
    91 function can_associate_posts() : bool {
     101function can_associate_posts(): bool {
    92102    return current_user_can( 'edit_posts' );
    93103}
     
    101111 * @return \WP_REST_Response The response data.
    102112 */
    103 function handle_rest_associate( \WP_REST_Request $request ) : \WP_REST_Response {
     113function handle_rest_associate( \WP_REST_Request $request ): \WP_REST_Response {
    104114    $post_id            = (int) $request->get_param( 'postId' );
    105115    $associated_post_id = (int) $request->get_param( 'associatedPostId' );
  • shadow-terms/tags/1.1.0/plugin.php

    r2914474 r2966107  
    33 * Plugin Name:  Shadow Terms
    44 * Description:  Use terms from generated taxonomies to associate related content.
    5  * Version:      1.0.1
     5 * Version:      1.1.0
    66 * Plugin URI:   https://github.com/happyprime/shadow-terms/
    77 * Author:       Happy Prime
  • shadow-terms/tags/1.1.0/readme.txt

    r2914474 r2966107  
    33Tags: terms, related, content
    44Requires at least: 5.9
    5 Tested up to: 6.2
    6 Stable tag: 1.0.1
     5Tested up to: 6.3
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88Requires PHP: 7.4
     
    4141## Changelog
    4242
     43### 1.1.0
     44
     45* Add filtering to shadow taxonomy taxonomy arguments.
     46* Update development tooling.
     47
    4348### 1.0.1
    4449
  • shadow-terms/trunk/LICENSE

    r2825530 r2966107  
    11Shadow Terms plugin for WordPress
    22
    3 Copyright 2022 by Happy Prime and contributors
     3Copyright 2022-2023 by Happy Prime and contributors
    44
    55This program is free software; you can redistribute it and/or modify
     
    362362
    363363The source code for any program binaries or compressed scripts that are
    364 included with Turn Comments Off can be freely obtained at the following URL:
     364included with Shadow Terms can be freely obtained at the following URL:
    365365
    366366    https://github.com/happyprime/shadow-terms/
  • shadow-terms/trunk/includes/api.php

    r2825530 r2966107  
    1616 * @return string The shadow taxonomy slug. Empty if not found.
    1717 */
    18 function get_taxonomy_slug( int $post_id ) : string {
     18function get_taxonomy_slug( int $post_id ): string {
    1919    $post = get_post( $post_id );
    2020
     
    4040 * @return int The term ID. 0 if not available.
    4141 */
    42 function get_term_id( int $post_id ) : int {
     42function get_term_id( int $post_id ): int {
    4343    $post = get_post( $post_id );
    4444
     
    7070 * @return int The post ID. 0 if not found.
    7171 */
    72 function get_post_id( int $term_id ) : int {
     72function get_post_id( int $term_id ): int {
    7373    $term = get_term( $term_id );
    7474
     
    108108 *               the shadow taxonomy.
    109109 */
    110 function get_connected_post_types( string $post_type ) : array {
     110function get_connected_post_types( string $post_type ): array {
    111111    $supports = get_all_post_type_supports( $post_type );
    112112
  • shadow-terms/trunk/includes/sync.php

    r2914474 r2966107  
    2222 * @param null|\WP_Post $post_before The post object before the update.
    2323 */
    24 function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ) : void {
     24function sync_shadow_taxonomies( int $post_id, \WP_Post $post_after, bool $update, $post_before ): void {
    2525    // The post before object may be null for new posts, so juggle that
    2626    // possibility to capture status and title before doing anything else.
     
    103103 * @param \WP_Post $post    The post object.
    104104 */
    105 function delete_term( int $post_id, \WP_Post $post ) : void {
     105function delete_term( int $post_id, \WP_Post $post ): void {
    106106    if ( ! post_type_supports( $post->post_type, 'shadow-terms' ) ) {
    107107        return;
  • shadow-terms/trunk/includes/taxonomy.php

    r2825530 r2966107  
    2323 * @since 1.0.0
    2424 */
    25 function register() : void {
     25function register(): void {
    2626    $post_types = get_post_types_by_support( 'shadow-terms' );
    2727
     
    3636 * @since 1.0.0
    3737 */
    38 function register_route() : void {
     38function register_route(): void {
    3939    // Register a REST route used to associate posts with a post's shadow term.
    4040    register_rest_route(
     
    5757 *                          be registered.
    5858 */
    59 function register_taxonomy( string $post_type ) : void {
     59function register_taxonomy( string $post_type ): void {
    6060    $post_type_object = get_post_type_object( $post_type );
    6161
     
    7575    );
    7676
     77    /**
     78     * Filter the arguments used to register a shadow taxonomy.
     79     *
     80     * @since 1.1.0
     81     *
     82     * @param array  $args      The arguments used to register the taxonomy.
     83     * @param string $post_type The post type this taxonomy is shadowing.
     84     */
     85    $args = apply_filters( 'shadow_terms_register_taxonomy_args', $args, $post_type );
     86
    7787    \register_taxonomy(
    7888        $post_type . '_connect',
     
    8999 * @return bool True if capable. False if not.
    90100 */
    91 function can_associate_posts() : bool {
     101function can_associate_posts(): bool {
    92102    return current_user_can( 'edit_posts' );
    93103}
     
    101111 * @return \WP_REST_Response The response data.
    102112 */
    103 function handle_rest_associate( \WP_REST_Request $request ) : \WP_REST_Response {
     113function handle_rest_associate( \WP_REST_Request $request ): \WP_REST_Response {
    104114    $post_id            = (int) $request->get_param( 'postId' );
    105115    $associated_post_id = (int) $request->get_param( 'associatedPostId' );
  • shadow-terms/trunk/plugin.php

    r2914474 r2966107  
    33 * Plugin Name:  Shadow Terms
    44 * Description:  Use terms from generated taxonomies to associate related content.
    5  * Version:      1.0.1
     5 * Version:      1.1.0
    66 * Plugin URI:   https://github.com/happyprime/shadow-terms/
    77 * Author:       Happy Prime
  • shadow-terms/trunk/readme.txt

    r2914474 r2966107  
    33Tags: terms, related, content
    44Requires at least: 5.9
    5 Tested up to: 6.2
    6 Stable tag: 1.0.1
     5Tested up to: 6.3
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88Requires PHP: 7.4
     
    4141## Changelog
    4242
     43### 1.1.0
     44
     45* Add filtering to shadow taxonomy taxonomy arguments.
     46* Update development tooling.
     47
    4348### 1.0.1
    4449
Note: See TracChangeset for help on using the changeset viewer.