Help for WP Notices v1.2.2

WP Notices is a flexible way to display notices to readers.

Notices can be targeted by WordPress user role (admin, editor, contributor, author, subscriber, reader, anon or any other configured role), by WordPress capabilities (manage_plugins, read, delete_pages or any other configured capability) or targeted at a specific user.

Notice messages can be displayed as text or each message can be automatically converted to a PNG image. Useful for displaying advisory notices that you prefer search engines do not index as text. Useful for creating post images on the fly. The image directory is wiped periodically so download and move images to your WordPress media library if you want to keep them (remember to add them to the post as images from the media library).

The time or period of display can be set using natural language. Display notices forever (by leaving out a start and end time period), from a set start time to an open ended end date, for a specific day, range of days for one time or ad infinnitum. For example start="Thursday 8am" End="Friday" would display a notice every Thursday from 8am until start of Friday or start="Thursday 8am" End="Friday 4:30pm" would display a notice every Thursday from 8am until 4:30pm Friday; you can even say start="Wednesday 1st June 2016 8am" End="Friday 24th June 2016".

The notice can be styled to change its appearance. There are four inbuilt style classes (alert-success, alert-info, alert-warning and alert-danger).

There is a help message built into WP Notices. When using the WP Notices shortcode set help=\true\ to display the help information.

WP Notices is written to be used to display notices to specific users, user groups or to all readers. It can easily also be used as a flexible lightweight way to show page content to specific users (the style classes are optional) or as a membership plugin (though you would need to configure your membership roles manually).

WP Notices has been tested. It is known to work. If you find a bug, let us know. Support will be provided to fix bugs. We are busy with regular work duties so support may be slow on occasion and anyone who does not read the FAQs before posting a support request will be promptly pointed to read the FAQs.

Instructions

WP Notices is shortcode driven.

The shortcode with all attributes is:

The shortcode with all attributes is:

[wp-notice to='admin' class='alert alert-success' css='' start='Tuesday 1pm' end='Tuesday 5pm' image='portrait' format='c4' files='pdf,html,png' html5='false' help='true']Message to display to admin users every Tuesday between 1pm and 5pm.[/wp-notice]

The shortcode has 10 attributes: to='', class='', css='', start='', end='', image='', format='', files='', html5='' and help=''.

The message displayed can contain any HTML that is allowed within regular post content such as <h1>, <p>, <em>, <strong>, <br>, <hr>, <ul> and so on. If you use HTML tags that do not show in the message then that will be because they were filtered out.

As well as regular WordPress user roles and capabilities, there are several aliases you can use in the to='' attribute. For example to='admin' is the same as to='administrator', use 'anon' to reach all none logged in users, use 'loggedin' to reach all loggedin users and use 'everyone' to display your message to everyone.

User roles, capabilities and usernames cannot currently be combined to reach multiple groups or multiple users.

User roles are role specific e.g. to='admin' will display a message to admin users but not to editors, authors, contributors or subscribers.

Notices that target user capabilities cascade upwards to users with higher capabilities but not downwards to those with lower capabilities e.g. if the notice is to='delete_others_pages' then editors and admins will see the message (they both share this capability) but authors, contributors and subscribers will not see the message.

Image inbuilt formats for format='' are ( format (width*height) ):

Custom Image Dimensions

Custom image dimensions can be set using the attributes image='' and format=''. Instead of using image='landscape' or image='portrait' you can use image='@number', replacing number with an actual integer value such as image='@400'. Use format='' to specify the height e.g. format='300' (the @ sign is optional for format). For example, to describe an image of 400 points by 800 points, use image='@400' format='800'.

Reference Links

PHP natural language time reference information (Relative Times).

WordPress roles and capabilities list. These are used in the "to" field.

Frequently Asked Questions

Why do iFrames and videos not show in image mode?

This is a limitation of the software used to create PDFs. In order to create images we first convert the notice message to PDF format. The PDF is then converted to an image. The image is what you see.

iFrame content will display as a non-clickable link.

Can I use images in the notice message?

Yes you can. Add the image as you normally would for a post or text widget.

Can I use shortcodes within the WP-Notices shortcode (nested shortcodes)?

Yes.

Can I use background images?

Yes. Either in the CSS or using the background='' attribute.

Can I use my own CSS?

Yes. Use the css='' attribute to add CSS style attributes. Use css='@' to load the custom.css stylesheet. The custom.css stylesheet is in wp-content/wp-uploads/wp-notices/SITE-ID/css/custom.css

We are still deciding whether to allow specific custom CSS files to be called. The option may be added at a future date.

Why does my notice message not include my CSS styles when image mode is used?

The CSS style rules must be loaded through css='' either as inline styles or through the custom.css file. This is because PDF creation (which leads to image creation) takes place outside of the WordPress core code.

Why do some messages still show after the message has expired?

This is caused by a limitation in cache plugins. We can either not cache pages that display notice messages (we're considering adding a nocache='' option but are worried notices shown in widget areas would then cause all pages to not be cached...) or we can ask you to clear the cache for specific pages or clear the cache for the whole site manually. We prefer to ask you to clear the page/site cache if you notice a message is cached too long.

We do send a 'Do Not Cache' alert to cache plugins for pages that display WP Notices to logged in readers. This prevents leakage to unintended readers.

Can I use the shortcode in widget areas?

You can. The WP Notices shortcode can be used in a text widget. Keep in mind that WP Notices sends a Do Not Cache alert to file cache plugins to prevent notice messages being displayed after expiration or to the wrong users. When you use WP Notices in a widget area you will need to use widget visibility controls, such as with the Jetpack Widget Visibility module, to narrow display of the text widget to only the pages where you want the widget to display. The next version of WP Notices will implement a method of notice display without need to disable page caching.

Where can I send donations?

Donations are welcome. They can be sent to us through [PayPal](https://paypal.me/vr51)

Can I contribute

Yes you can! Join us on [GitHub](https://github.com/VR51/WP-Notices/)