Users in general like features, in the same way kids like candies, the more features there is the happier they are. The best way to make a user happy is to tell him something like this:
“Oh, you need this feature? No problem, we will implement it in the next release.”
Filter- and actions hooks
We support this filters for public use.
- cpwp_custom_placeholder
- Custom field need code to get the return value(s). (New in 4.9).
- Parameters: Custom_field_name (string), this (object), settings (array)
- cpwp_post_url
- All links to the post (only the Url, no HTML): The thumbnail link, the excerpt more, the Post Details option ‘everything is a link’ or the Style > positioning option thumbnail at ‘background’ is selected.
- Parameters: the_permaink (string), this (object), settings (array)
- cpwp_post_html
- HTML for each post. (+4.8 or higher).
- Parameters: post HTML (string), this (object), settings (array)
- cpwp_excerpt
- Set after the widget excerpt code.
- Parameters: excerpt (string)
- widget_title
- Will be apply if the widget is placed in a widget-area and not as shortcode. If the widget is placed as shortcode disable the widget title and set the title in the content text with the editor.
- Parameters: title (string)
- cpwp_possible_sorts
- Dropdown control in the back-end UI and set the internal query.
- Parameters: possible sorts (array)
- cpwp_query_args
- The array that can be fed to wp_Query to get the relevant posts
- Parameters: args (array), this (object), settings (array)
Examples
Here is an easy example where we use to expand the query filter.
Widget Extensions / UI control panels
We also use the filters for all our widget extensions.
To have new UI controls in the admin panel, we give filters to override the hole panel HTML.
- cpwp_details_panel
- Override the UI for theDetails panel
- Parameters: this (object), settings (array), name (string), headline (string), “” (optional)
- cpwp_alt_details_panel
- Override the UI for theDetails panel
- Parameters: this (object), settings (array), name (string), headline (string), “alt_” (optional)