A simple plugin to show different content to registered and non-registered users using shortcodes.
Registered users will see the content that you provide within the shortcode tags, while non-registered users will see the content you set in the plugin settings.
The install process is simple follow the manual install instructions below:
Visibility Custom Content comes with additional options, but let's start step by step
After activating the plugin go plugin's option page. In your Dashboard, sidebar will display a new button, a new navigation tab named Custom Content with a lock icon.
From this section we can setup a few options.
The shortcode which can be used in any part of your website (article, single post type, page, custom post type, archive type, widget) is [custom_content]...your content here...[custom_content]
1. Presets
Choose from available presets or add your own content using the Editor tool.
The drop-down has 6 presets available, basically 6 custom HTML with inline css code snippets which prepopulate the Editor when selected.
Use the Text tab of the native wordpress Editor to view the markup code.
1.1 Presets - Use of Presets or adding custom content
The presets option is pre populating the Editor with 6 code snippets but it is your choice if you want to use them or not.
Optional action. Delete the code snippet of selected preset from Editor and add your own content.
Note: there's an issue with added images via manual coding. The Editor adds backslashes and the image will no longer display properly upon saving the changes.
Please remember, the content added within this section is visible to non members.
1.2 Presets - Push for development
If you have some basic programming skills, you can add more presets by manually editing the Preselect function from js file js/vcs-content-admin.js and update the functionality within the plugin's main file custom-content-plugin.php. Search for the echo "<select id='preset-select'>"; line and from there you can see the options within the from element.
1.3 Editor
The editor is using the core worpdpress native editor so if you are using the Classic one, that will be available for you, if you have other extensions which show up in editor UI, then, all those will also be available to you.
All information from v1.0 apply.
The extended version is compatible with the "new wordpress editor", the block editor.
1. Flexibility of the shortcode - Block element
When starting a new post or writing content for a new page and new block editor is used, search for Custom Content block.
1.2 Flexibility of the shortcode - Block element settings
Settings of this custom block element are simple and easy to use.
The right sidebar of the editor is displaying all available options like:
background-position:center;. Please note: when using the background image option, the background color will no longer be visible.3. Flexibility of the shortcode - Magic within
Use any shortcode within the shortcode.
Use most of the markup language to create your custom content.
I've tested the WPCode (Wow Plugins) shortcodes with this plugin and no conflicts. Of course a good practice is to avoid the same class or id names.
In previous version I've noticed that there's no option to remove the background image which I previously set up so, the v1.1.1 update enables that functionality and more. Read the v1.1.1 release notes.
When I said flexibility, I meant flexibility
1. Basic Usage
In Classic editor the shortcode can be used like this
Registered members will see:
your content here
Visitors will see:
whatever content you've set in plugin's settings page and even the content which is outside of the shortcode tags (if any)
Another example:
Registered members will see:
1. Content visible for registered members
2. Content visible for both registered and non-registered members.
Visitors will see:
1. whatever content you've set in plugin's settings page and even the content which is outside of the shortcode tags (if any)
2. Content visible for both registered and non-registered members.
1.1 Basic Usage - with markup
The shorcode is rendering ok most of the HTML and inline CSS markup so here's an example markup used within the shortcode
Will render:
This is content added manually with basic HTML tags
Links can be added too, like this a link
Of course, if no inline styles are specified, the HTML tags will automatically inherit your theme's global css
1.2 Extended Usage - shortcode within
As mentioned above, most shortcodes are rendering ok and here's how I tested this:
I've used a shortcode from another plugin which allows me to add different code snippets here and there on my platform, and another shortcode with some share buttons, both codes worked perfectly
On frontend both shortcodes were rendering their content within main [custom_content]
Yes, there's a lot of work to be done, a lot of improvements yet I want a lite plugin, low on resources but functional
Some ideas might work, some might not but here's the list:
Because the plugin is not added in Wordpress plugin's library, there are two external files which display dynamic content.
Both files are also hosted by github and the they are called by the main plugin's php file.
First file is the version text file which you can see it at the very bottom (right) of the info section and the content is changed manually when a new version is released
The second file should be a notification version which shows up in option page of the plugin. I did added a cookie to it in order to not show if you click the "x" icon but it seems I didn't do a good job because it should read if there were changes made since last visit and display the New Version notification even if user clicked the "x" close button. Anyway, the file is this, and is manually edited with the download link