-
Notifications
You must be signed in to change notification settings - Fork 1
Hooks
Many hooks are available in the plugin code to change its default behaviour or extend its logic.
If you think that a vital hook is missing, just let us know by creating an issue and we will fix this!
Allows changing the predefined color palette displayed in the "Main color" Achievement field.
- Type: array
-
Default value:
[ '#00171F', '#5BC0EB', '#FDE74C', '#9BC53D', '#FA7921', '#D90429', '#7D5CD1', '#FF80D9' ]
- Extra params: none
Allows extending the list of Timeline themes available. See the custom theme plugin repo for a practical example.
-
Type: associative array (key is a theme slug, value is an instance of a
Abstract_Theme
-extended class object) -
Default value:
[ 'minimalist' => new \WP_Timeliner\Themes\Minimalist\Minimalist_Theme(), 'snake' => new \WP_Timeliner\Themes\Snake\Snake_Theme() ]
- Extra params: none
Allows changing the path to a template file that will be loaded by the plugin. Useful to force a different location for the
taxonomy-wpt-timeline.php
template file if necessary.
- Type: string
-
Default value:
$template
-
Extra params:
$template_name, $template_path, $default_path
Allows disabling the loading of FontAwesome icon webfont.
- Type: boolean
-
Default value:
true
- Extra params: none
Allows disabling the loading of a specific timeline theme CSS.
- Type: boolean
-
Default value:
true
-
Extra params:
$theme_slug
Allows disabling the loading of current-theme-compatibility logic provided by the plugin.
- Type: boolean
-
Default value:
true
- Extra params: $current_theme
Allows changing the date format used for displaying the achievement date on a timeline.
- Type: string: A valid PHP date format.
-
Default value:
$date_format
-
Extra params:
$timeline_date_format, $achievement, $timeline
Allows changing the formatting of a date computed-string when displaying only one start date.
-
Type: string: A
sprintf()
-friendly string -
Default value:
%1$s
- Extra params: $timeline_date_format, $achievement, $timeline
Allows changing the formatting of a date computed-string when displaying a start and an end date.
-
Type: string: A
sprintf()
-friendly string -
Default value:
From %1$s to %2$s
- Extra params: $timeline_date_format, $achievement, $timeline
Allows adding new metaboxes to Achievement admin pages. Requires an
id
and atitle
.
- Type: array
-
Default value:
$metaboxes: The Achievement plugin default metaboxes
- Extra params: none
- Example:
function alter_achievement_metaboxes( $metaboxes ) {
$metaboxes[] = [
'id' => 'new_metabox',
'title' => 'My new Achievement metabox!',
];
return $metaboxes;
}
add_filter( 'wpt.metaboxes.achievement', 'alter_achievement_metaboxes', 10 );
Allows adding new metaboxes to Timeline admin pages. Requires an
id
and atitle
.
- Type: array
-
Default value:
$metaboxes: The Timeline plugin default metaboxes
- Extra params: none
- Example: see above
Allows adding fields to your newly registered metabox on Achievement admin pages.
-
Type: array of
Carbon_Fields\Field\Field
field objects -
Default value:
[]
- Extra params: none
- See:: https://carbonfields.net/docs/fields-usage/?crb_version=2-2-0
- Example:
function alter_achievement_fields( $fields ) {
$fields[] = Carbon_Fields\Field\Field::make( 'text', 'new_field', 'My new field!' );
return $fields;
}
add_filter( 'wpt.fields.achievement.new_metabox', 'alter_achievement_fields', 10 );
Allows adding fields to your newly registered metabox on Timeline admin pages.
-
Type: array of
Carbon_Fields\Field\Field
field objects -
Default value:
[]
- Extra params: none
- See:: https://carbonfields.net/docs/fields-usage/?crb_version=2-2-0
- Example: see above
TODO !