BJO102Press WP GitLab
A plugin with helpers that I've developed in WordPress over the years.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://gitlab.com/bjo102/bjo102press/-/archive/master/bjo102press-master.zipReadme
BJO102Press
This is a plugin with helpers that I've developed in WordPress over the years.
Features
- Site Administrator User Role (Clients)
- Admin Dashboard Customisations
- Helper Methods
- Shortcodes
- Elementor Galleries
- AJAX Posts Archives
- Post Single Navigation
- Filter Hooks
Installation
If you're cloning this project, remember to run composer install as this relies on the vendor directory to work.
Site Administratior
UserRoles/initClientRole.php
This is our custom user role for clients. In previous versions, this was thought of as an administrator with capabilities removed, now it's more like an editor with capabilities added. It's important that clients are not able to install plugins, edit themes code, or change essential settings for the site.
Alert: Due to changing client requirements, such as full access to the Elementor Theme Builder, the manage_options has been granted to this user role. This should be changed - grant access to the Theme Builder but not WordPress general settings.
Admin Dashboard Customisations
classes/Admin.php
The WordPress logo in the admin bar should be removed, and the branding on the admin footer should be replaced with that of your own brand
DVWP Settings
Views/AdminSettingsMain.php
Current location: Settings > DVWP settings
Branding
- Login Logo image and link.
- Login screen colour scheme.
- Admin branding.
Helper Methods
BJO102Press comes with helper functions for some basic
You can find all of these helper methods in Classes/Utils.php.
Shortcodes
Shortcodes are loaded in classes/Shortcodes.php and are defined in the Shortcodes folder.
[dv_posts]
A posts archive with ajax filtering capabilities.
See Classes/Posts.php for how this works.
[dv_elementor_gallery]
An image gallery that uses Elementor Code for modal slideshows.
See Classes/ElementorGallery.php for how this works.
[dv_post_single_navigation]
An automatically generated navigation menu for a post, with links to certain elements within the content.
The content is pre-filtered for headings, and then a custom attribute to them. The same functions and arguements are used to generate menu items and anchor links (no need to use IDs).
See Main.php and Utils.php for how this works.
Filter Hooks
dv_admin_footer_text
Change the text that appears in the admin dashboard footer next to the Cloud Daemons logo.
dv_posts_wp_args
Filter the WP Query arguements of the Posts class.
dv_posts_post_details
Filter the html which appears on each post in an archive generated by the Posts class.
dv_posts_orderby_options
Change the orderby labels and accociated queries in the sort selection generated by the Posts class.
dv_posts_tax_filters_terms_args
Filter the arguements used in get_terms() when generating taxonomy filters of the Posts class.
Filter Hooks
dvwp_main_settings_page_submission
Fires after the DVWP Settings Form submission and nonce field have been confirmed, and all field submissions are being processed. Use this hook to handle custom field POST submissions on this page.
dvwp_main_settings_page_after
Fires after the end of all fieldsets in the DVWP Settings page form. Use this hook to add more fields to this form.