Restrict custom post type to only site administrator role

register_post_type() accepts a parameter capabilities in its arguments. See get_post_type_capabilities() for possible values. From the comments: By default, seven keys are accepted as part of the capabilities array: edit_post, read_post, and delete_post are meta capabilities, which are then generally mapped to corresponding primitive capabilities depending on the context, which would be the post being edited/read/deleted … Read more

Creative uses of WordPress [closed]

Contact Manager http://rolopress.com/ Organize contacts and companies… your way. Easily enter and modify contacts and companies Keep track of phone numbers, email addresses, websites, social networks and many other types of information. Create your own Themes. Add functionality by installing Plugins. (or write your own) (replaced by piklist crm http://piklist.com )

How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)

style_loader_tag style_loader_tag is an official WordPress API, see the documentation: https://developer.wordpress.org/reference/hooks/style_loader_tag/ apply_filters( ‘style_loader_tag’, $html, $handle, $href, $media )Filters the HTML link tag of an enqueued style. First enqueue your stylesheet, see documentation: https://developer.wordpress.org/reference/functions/wp_enqueue_style/ wp_enqueue_style( ‘font-awesome-5’, ‘https://use.fontawesome.com/releases/v5.5.0/css/all.css’, array(), null ); The $handle is ‘font-awesome-5’ I do null so that there is no version number. This way … Read more

Pass boolean value in shortcode

Is easy to use 0 and 1 values and then typecasting inside the function: [shortcode boolean_attribute=”1″] or [shortcode boolean_attribute=”0″] but if you want you can also strictly check for ‘false’ and assign it to boolean, in this way you can also use: [shortcode boolean_attribute=”false”] or [shortcode boolean_attribute=”true”] Then: add_shortcode( ‘shortcode’, ‘shortcode_cb’ ); function shortcode_cb( $atts … Read more

Proper Way to Modify Plugin

IMHO, the best approach is either to fork the Plugin to maintain your changes, or else submit patches to the Plugin developer, to have your changes made a part of the original Plugin. Creating a “Child Plugin” really isn’t easy. The “Child Theme” concept really applies to the template files that get used, moreso than … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)