New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating custom options for "List-item" option in Option Tree #329
Comments
@danielchikaka Your code looks correct. Unfortunately, the Example code: /**
* Filters the required title field's label.
*/
function filter_list_item_title_label( $label, $id ) {
if ( $id == 'your_list_item_id' ) {
$label = __( 'Content Title', 'theme-domain' );
}
return $label;
}
add_filter( 'ot_list_item_title_label', 'filter_list_item_title_label', 10, 2 );
/**
* Filters the required title field's description.
*/
function filter_list_item_title_desc( $label, $id ) {
if ( $id == 'your_list_item_id' ) {
$label = __( 'Add a title only you will see. This makes it easier to drag & drop.', 'theme-domain' );
}
return $label;
}
add_filter( 'ot_list_item_title_desc', 'filter_list_item_title_desc', 10, 2 ); |
How do you delete all options except the title? Just to make a simple list without any content or images, etc... |
There is a filter you can use to filter the settings for a list-item type that will do what you want. I'm on my phone and don't know it off hand. I'll check when I get back in front of a computer. |
function filter_ot_list_item_settings( $settings, $id ) {
// Title only
if ( 'your_option_id' === $id ) {
return array();
}
return $settings;
}
add_filter( 'ot_list_item_settings', 'filter_ot_list_item_settings', 10, 2 ); |
Thanks @valendesigns ! |
Is it possible to add some of the fields and not others, I know the |
Hey guys, I have a problem, I need to change the default options for a “List-item” option in Option tree . Right now the default are “Title/Image/Link/Descriptions” .. I want to remove them and add my own. I have written this code:
but when i preview the themes options , the default list item "title" is still there and i only want to see the Academic Success textarea. What should i do?
The text was updated successfully, but these errors were encountered: