Plugin Directory

Changeset 1594284


Ignore:
Timestamp:
02/12/2017 04:30:48 PM (9 years ago)
Author:
allnull
Message:

support signature placement shortcode;

Location:
wp-post-signature/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-post-signature/trunk/readme.txt

    r1594244 r1594284  
    2929
    3030== Changelog ==
     31
     32= 0.3.7 =
     33* support signature placement shortcode. Thanks to @scanlab.
    3134
    3235= 0.3.6 =
  • wp-post-signature/trunk/wp-post-signature-page.php

    r1594248 r1594284  
    227227    <p><?php _e('Where should the signature be placed?', 'wp-post-signature'); ?></p>
    228228    <input type="radio" name="signature_pos" value="top" <?php if($this->getStr($current_signature, 'signature_pos') == 'top') { echo 'checked="checked"'; } ?> /><?php _e('Top', 'wp-post-signature'); ?>
    229     <input type="radio" name="signature_pos" value="bottom" <?php if($this->getStr($current_signature, 'signature_pos') == 'bottom') { echo 'checked="checked"'; } ?> /><?php _e('Bottom', 'wp-post-signature'); ?><br />
     229    <input type="radio" name="signature_pos" value="bottom" <?php if($this->getStr($current_signature, 'signature_pos') == 'bottom') { echo 'checked="checked"'; } ?> /><?php _e('Bottom', 'wp-post-signature'); ?>
     230    <input type="radio" name="signature_pos" value="custom" <?php if($this->getStr($current_signature, 'signature_pos') == 'custom') { echo 'checked="checked"'; } ?> /><?php _e('Custom', 'wp-post-signature'); ?>
     231    <input type="text" name="signature_pos_mark" value="<?php echo stripslashes($this->getStr($current_signature, 'signature_pos_mark')); ?>" placeholder="<!-- SIGNATURE_MARK -->" /><br />
    230232
    231233    <p><?php _e('Will the signature be appended to the excerpts of posts?', 'wp-post-signature'); ?></p>
  • wp-post-signature/trunk/wp-post-signature.php

    r1594244 r1594284  
    44Plugin URI: http://wordpress.org/extend/plugins/wp-post-signature/
    55Description: This plugin allows you to append a signature after every post. Some variables can be used, such as %post_title%, %post_link%, %bloginfo_name%, %bloginfo_url%, and so on. It supports multiuser.
    6 Version: 0.3.6
     6Version: 0.3.7
    77Author: Soli
    88Author URI: https://solicomo.com
     
    134134    $env_vars['%author_meta_avatar%']           = get_avatar(get_the_author_meta('ID'));
    135135
    136     if($current_signature['signature_pos'] == 'top') {
     136    if ($current_signature['signature_pos'] == 'custom') {
     137        $signature_post_mark = '<!-- SIGNATURE_MARK -->';
     138        if (array_key_exists('signature_pos_mark', $current_signature) && !empty($current_signature['signature_pos_mark'])) {
     139            $signature_post_mark = $current_signature['signature_pos_mark'];
     140        }
     141        return str_replace($signature_post_mark, strtr(stripslashes($current_signature['signature_text']), $env_vars), $content);
     142    } else if($current_signature['signature_pos'] == 'top') {
    137143        return strtr(stripslashes($current_signature['signature_text']), $env_vars) . $content;
    138144    } else {
Note: See TracChangeset for help on using the changeset viewer.