(→Examples) |
(→Examples) |
||
| Line 29: | Line 29: | ||
== Examples == | == Examples == | ||
| − | A very simple modification to make, removing the features section altogether from the theme Welcome page may be a bit elusive. As noted above the filter . | + | A very simple modification to make, removing the features section altogether from the theme Welcome page may be a bit elusive. As noted above the filter works with an array of arrays, so to return nothing then you should return an empty array. You can build your own function to do this or simply use a WordPress helper function: |
| + | <syntaxhighlight><?php add_filter( 'pagelines_welcome_features', '__return_empty_array' ); ?></syntaxhighlight> | ||
pagelines_welcome_features is used by get_welcome_features to return an array of the theme features on the theme Welcome page.
array(
'name' => __( 'My First Feature', 'my-textdomain' ),
'desc' => __( 'The description for My First Feature', 'my-textdomain' ),
'class' => __( 'feature_dynamic' ), /* CSS class - borrowed for example purposes */
'icon' => '',
),
);
return $my_features;
}
?>
The array of arrays consists of an array of features; and each feature consists of an array of the following items:
NB: my_pagelines_welcome_features is an example name, please use a more appropriately named function in your code. Also to note, my-textdomain should be the same textdomain you are using for your theme.
A very simple modification to make, removing the features section altogether from the theme Welcome page may be a bit elusive. As noted above the filter works with an array of arrays, so to return nothing then you should return an empty array. You can build your own function to do this or simply use a WordPress helper function: