Plugin Directory

Changeset 2130111


Ignore:
Timestamp:
07/29/2019 11:15:20 AM (7 years ago)
Author:
deano1987
Message:
  • added short description box, no longer relies on SEO Ultimate.
Location:
advanced-author-box
Files:
50 added
2 edited

Legend:

Unmodified
Added
Removed
  • advanced-author-box/trunk/advanced-author-box.php

    r2116044 r2130111  
    44Plugin URI:
    55Description: This is a plugin that adds an author box to the end of your WordPress posts - a fork of Guerrilla's autherbox plugin but with amp support
    6 Version: 1.5.4
     6Version: 1.5.5
    77Author: deano1987
    88Author URI: http://deano.me
     
    120120                                $rows[] = array(
    121121                                    "id" => "authordesc",
    122                                     "label" => __('Use SEO Ultimate Meta Description For Card'),
     122                                    "label" => __('Use Short Description For Card'),
    123123                                    "content" => '<label>No <input type="radio" name="authordesc" id="authordesc" value="0" '.($opt['authordesc'] == 0 ? 'checked="checked"' : '').' /></label> <label>Yes <input type="radio" name="authordesc" id="authordesc" value="1" '.($opt['authordesc'] == 1 ? 'checked="checked"' : '').' /></label>',
    124124                                );
     
    288288    return $content;
    289289}
     290
     291
     292
     293
     294function fb_add_custom_user_profile_fields( $user ) {
    290295?>
     296    <h3><?php _e('Author Box', 'your_textdomain'); ?></h3>
     297   
     298    <table class="form-table">
     299        <tr>
     300            <th>
     301                <label for="author_desc">Short Description
     302            </label></th>
     303            <td>
     304                <? /*<textarea name="author_desc" id="author_desc" style="width:100%;height:300px" ><?php echo esc_attr( get_the_author_meta( 'author_desc', $user->ID ) ); ?></textarea><br />*/
     305                $settings = array( 'media_buttons' => false,'quicktags' => false );
     306                $content = esc_attr( get_the_author_meta( 'author_desc', $user->ID ) );                     
     307                $editor_id = 'author_desc';
     308                wp_editor( $content, $editor_id,$settings );
     309                ?>
     310            </td>
     311        </tr>
     312    </table>
     313<?php }
     314
     315function fb_save_custom_user_profile_fields( $user_id ) {
     316   
     317    if ( !current_user_can( 'edit_user', $user_id ) )
     318        return FALSE;
     319   
     320    update_usermeta( $user_id, 'author_desc', $_POST['author_desc'] );
     321}
     322
     323add_action( 'show_user_profile', 'fb_add_custom_user_profile_fields' );
     324add_action( 'edit_user_profile', 'fb_add_custom_user_profile_fields' );
     325
     326add_action( 'personal_options_update', 'fb_save_custom_user_profile_fields' );
     327add_action( 'edit_user_profile_update', 'fb_save_custom_user_profile_fields' );
     328?>
  • advanced-author-box/trunk/readme.txt

    r2116044 r2130111  
    44Requires at least: 3.0
    55Tested up to: 4.9.8
    6 Stable tag: 1.5.4
     6Stable tag: 1.5.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141== Changelog ==
    4242
     43= 1.5.5 =
     44* added short description box, no longer relies on SEO Ultimate.
     45
    4346= 1.5.4 =
    4447* added alt tags to images on amp version of author box.
Note: See TracChangeset for help on using the changeset viewer.