Changeset 2275530
- Timestamp:
- 04/03/2020 11:03:49 PM (6 years ago)
- Location:
- vi-member-content/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
vi_member_content.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vi-member-content/trunk/readme.txt
r2228618 r2275530 5 5 Requires at least: ? 6 6 Tested up to: 5.3 7 Version: 9.1.200 1157 Version: 9.1.200310 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 17 17 Content separated by user role/ability 18 18 19 See Installation for a list of Shortcodes 20 19 https://wordpress.org/plugins/vi-member-content/ 21 20 22 21 == Installation == … … 53 52 54 53 = 9.1.200115 = 54 * Update: default logged in value is not a predefined role or capability 55 * "any" is used internally to note "any" logged in user when no role or capability is specified 56 57 = 9.1.200115 = 55 58 * Fixed bug: potential for empty string in foreach 56 59 * Edit: moved check if $content is null earlier to skip doing extra work -
vi-member-content/trunk/vi_member_content.php
r2228618 r2275530 4 4 Plugin URI: https://neathawk.com/2019/plugin-member-content/ 5 5 Description: A collection of generic functions that separate content by visitor/member/ member of type 6 Version: 9.1.200 1156 Version: 9.1.200310 7 7 Author: Joseph Neathawk 8 8 Author URI: http://Neathawk.com … … 35 35 36 36 /** 37 * display content to logged OUT users only37 * find if user has the given role 38 38 * 39 * return only boolean, let no secure data escape likean array of all the roles39 * return only boolean, let no secure data escape ie: an array of all the roles 40 40 * 41 41 * @link https://wordpress.stackexchange.com/questions/5047/how-to-check-if-a-user-is-in-a-specific-role … … 78 78 $content = ''; 79 79 } 80 81 //finally do any shortcodes on the content 82 //in an effort to play nice with other plugins 83 //also works with this plugin's nested shortcodes 80 84 return do_shortcode($content); 81 85 } … … 97 101 if ( !is_null( $content ) ) 98 102 { 99 extract( shortcode_atts( array( 'type' => 'read' ), $attr ) ); 103 //default value for all logged in users 104 extract( shortcode_atts( array( 'type' => 'any' ), $attr ) ); 100 105 //remove spaces 101 106 $type = str_replace(" ", "", $type); … … 103 108 104 109 //make absolutely sure $ability isn't empty 110 //reset the default if it is 105 111 if( !is_array($ability) ) 106 112 { 107 $ability[] = ' read';113 $ability[] = 'any'; 108 114 } 109 115 … … 134 140 } 135 141 142 //finally do any shortcodes on the content 143 //in an effort to play nice with other plugins 144 //also works with this plugin's nested shortcodes 136 145 return do_shortcode($content); 137 146 }
Note: See TracChangeset
for help on using the changeset viewer.