Plugin Directory

Changeset 3238650


Ignore:
Timestamp:
02/11/2025 02:57:08 PM (14 months ago)
Author:
Molongui
Message:

5.0.14 (2025-02-11)

  • Added: Filter to customize attributes for the author avatar <img> element.
Location:
molongui-authorship/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • molongui-authorship/trunk/README.txt

    r3238586 r3238650  
    197197
    198198<strong>Important</strong>: If you use a caching plugin, please clear your cache after updating any plugins.
     199
     200= 5.0.14 (2025-02-11) =
     201
     202* Added: Filter to customize attributes for the author avatar `<img>` element.
    199203
    200204= 5.0.13 (2025-02-11) =
  • molongui-authorship/trunk/changelog.txt

    r3238586 r3238650  
    22
    33== Changelog ==
     4
     5= 5.0.14 (2025-02-11) =
     6
     7* Added: Filter to customize attributes for the author avatar `<img>` element.
    48
    59= 5.0.13 (2025-02-11) =
  • molongui-authorship/trunk/i18n/molongui-authorship.pot

    r3238586 r3238650  
    77msgid ""
    88msgstr ""
    9 "Project-Id-Version: molongui-authorship 5.0.13\n"
     9"Project-Id-Version: molongui-authorship 5.0.14\n"
    1010"Report-Msgid-Bugs-To: \n"
    11 "POT-Creation-Date: 2025-02-11 13:49+0100\n"
     11"POT-Creation-Date: 2025-02-11 15:54+0100\n"
    1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • molongui-authorship/trunk/includes/admin/author-box-editor.php

    r3238586 r3238650  
    414414        wp_die();
    415415    }
    416     public function validate_spacing_options( $options, $current )
     416    public function validate_spacing_options( $options, $current = null )
    417417    {
    418418        $size = array
  • molongui-authorship/trunk/includes/author.php

    r3231805 r3238650  
    608608            }
    609609        }
     610
     611        /*!
     612         * FILTER HOOK
     613         * Allows filtering the attributes for the returned <img> HTML tag.
     614         *
     615         * add_filter( 'molongui_authorship/author_avatar_attr', function( $attr )
     616         * {
     617         *    //$attr = array_merge( $attr, array( 'extra_attr' => 'style="border-radius:100%;"' ) ); // This doesn't work!
     618         *      $attr = array_merge( $attr, array( 'style' => 'border-radius:100%;' ) );
     619         *
     620         *      $attr = array_merge( $attr, array( 'class' => 'myCustomClass' ) );
     621         *
     622         *      return $attr;
     623         * }
     624         *
     625         * @param array  $attr    HTML attributes to insert in the IMG element. Is not sanitized.
     626         * @param int    $id      The author's id.
     627         * @param int    $type    The author's type, either 'user' or 'guest'.
     628         * @param string $size    The size for the image {thumbnail | medium | medium_large | large | full | "array(x,y)"}.
     629         * @param string $context Usage context {screen | box | url}.
     630         * @param Author $this    The current author instance.
     631         * @since 5.0.14
     632         */
     633        $attr = apply_filters( 'molongui_authorship/author_avatar_attr', array_merge( $attr, array( 'width' => $width, 'height' => $height ) ), $this->id, $this->type, $size, $context, $this );
    610634        switch ( !empty( $source ) ? $source : ( !empty( $options['author_box_avatar_source'] ) ? $options['author_box_avatar_source'] : '' ) )
    611635        {
     
    613637                if ( $context != 'url' )
    614638                {
    615                     $this->avatar = $this->get_gravatar( array_merge( $attr, array( 'width' => $width, 'height' => $height ) ), $options );
     639                    $this->avatar = $this->get_gravatar( $attr, $options );
    616640                }
    617641                else
     
    624648                if ( $context != 'url' )
    625649                {
    626                     $this->avatar = $this->get_acronym( array_merge( $attr, array( 'width' => $width, 'height' => $height ) ), $options );
     650                    $this->avatar = $this->get_acronym( $attr, $options );
    627651                }
    628652                else
     
    684708                            else
    685709                            {
    686                                 $this->avatar = $this->get_gravatar( array_merge( $attr, array( 'width' => $width, 'height' => $height ) ), $options );
     710                                $this->avatar = $this->get_gravatar( $attr, $options );
    687711                            }
    688712                            break;
     
    691715                            if ( $context !== 'url' )
    692716                            {
    693                                 $this->avatar = $this->get_acronym( array_merge( $attr, array( 'width' => $width, 'height' => $height ) ), $options );
     717                                $this->avatar = $this->get_acronym( $attr, $options );
    694718                            }
    695719                            break;
  • molongui-authorship/trunk/molongui-authorship.php

    r3238586 r3238650  
    1313 * Plugin URI:        https://www.molongui.com/wordpress-plugin-post-authors
    1414 * Description:       All-in-One Authorship Solution: Seamless Author Box, Guest Authors, and Co-Authors to enhance your site's authority, credibility, engagement, and SEO.
    15  * Version:           5.0.13
     15 * Version:           5.0.14
    1616 * Requires at least: 5.2
    1717 * Tested up to:      6.7
     
    4444final class MolonguiAuthorship
    4545{
    46     const VERSION = '5.0.13';
     46    const VERSION = '5.0.14';
    4747    use Singleton;
    4848    function __construct()
Note: See TracChangeset for help on using the changeset viewer.