(→Usage) |
(→Usage) |
||
| (9 intermediate revisions by one user not shown) | |||
| Line 11: | Line 11: | ||
'myfirstfeature' => array( | 'myfirstfeature' => array( | ||
'name' => __( 'My First Feature', 'my-textdomain' ), | 'name' => __( 'My First Feature', 'my-textdomain' ), | ||
| − | 'desc' => __( ' | + | 'desc' => __( 'The description for My First Feature', 'my-textdomain' ), |
'class' => __( 'feature_dynamic' ), /* CSS class - borrowed for example purposes */ | 'class' => __( 'feature_dynamic' ), /* CSS class - borrowed for example purposes */ | ||
'icon' => '', | 'icon' => '', | ||
| Line 20: | Line 20: | ||
?></syntaxhighlight> | ?></syntaxhighlight> | ||
| − | The array of arrays consists of an array of features; and each feature consists of an array | + | The array of arrays consists of an array of features; and each feature consists of an array of the following items: |
* <tt>name</tt> - The display name of the feature. | * <tt>name</tt> - The display name of the feature. | ||
* <tt>desc</tt> - The description of the feature. | * <tt>desc</tt> - The description of the feature. | ||
* <tt>class</tt> - The specific CSS class being used as an element container displayed on the theme Welcome page. | * <tt>class</tt> - The specific CSS class being used as an element container displayed on the theme Welcome page. | ||
| − | * <tt>icon</tt> - | + | * <tt>icon</tt> - This is not currently implemented. |
NB: <tt>my_pagelines_welcome_features</tt> 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. | NB: <tt>my_pagelines_welcome_features</tt> 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. | ||
| + | |||
| + | == 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 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 the WordPress helper function that returns an empty array: | ||
| + | <syntaxhighlight><?php add_filter( 'pagelines_welcome_features', '__return_empty_array' ); ?></syntaxhighlight> | ||
| + | |||
| + | == Source File == | ||
| + | <tt>pagelines_welcome_features</tt> is defined in <tt>[[get_welcome_features|get_welcome_features()]]</tt> which is located in [http://phpxref.pagelines.com/nav.html?admin/class.welcome.php.source.html admin/class.welcome.php] | ||
| + | |||
| + | ---- | ||
| + | |||
| + | [[Category:Draft]] | ||
| + | [[Category:New Page]] | ||
| + | [[Category:Filters]] | ||
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 the WordPress helper function that returns an empty array:
pagelines_welcome_features is defined in get_welcome_features() which is located in admin/class.welcome.php