Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterAh, I got it. I will check that ๐
Thanks for your suggestion!
Anh Tran
KeymasterHere it is:
function hello() { return '<b style="color:red;">Hello</b>'; }Anh Tran
KeymasterHi,
How do you get the
$post_idand how do you use the code above inside your code to register meta boxes?Anh Tran
KeymasterI got it. In this case, the problem is handling the "saved meta value". I'd suggest using WP cron to perform a regular check on the meta value (posts). When a condition occurs (date is passed), then update the meta value.
This is the pseudo code:
register_activation_hook(__FILE__, 'prefix_activation'); function prefix_activation() { if (! wp_next_scheduled ( 'prefix_daily_check' )) { wp_schedule_event(time(), 'hourly', 'prefix_daily_check'); } } add_action('prefix_daily_check', 'prefix_update_posts_daily'); function prefix_update_posts_daily() { $now = time(); $option = get_option( 'featured_position_1' ); foreach ( $option as $key => $value ) { if ( $time > strtotime( $value['featured_item_1_schedule_start'] ) ) { unset( $option[$key] ); } } update_option( 'featured_position_1', $option ); }Anh Tran
KeymasterDear Dave,
Yes, all of 'em are Ok, can you please export your meta box and send me via email [email protected]? It's weird because I've tested one more time and it still works.
Anh Tran
KeymasterHi Locke2,
I'm not very clear about your question. Do you want a checkbox that when it's checked, the post will be set to "sticky"?
Anh Tran
KeymasterHi,
If an user selects:
- Post A from Feb 6 to Feb 10
- Post B from Feb 8 to Feb 12Then after Feb 6, the post A is removed from the selection (in the admin area)? Is that what you want?
Anh Tran
KeymasterJust looked at the code again and found that you "echo" the content instead of returning it. The callback function "must" return the content.
If your content is complicated, you should use output buffering to return it.
Anh Tran
KeymasterDo you mean using it for the ajax request for select_advanced field as you talked in another topic?
Anh Tran
KeymasterHi Jackky, let me check and fix that. Thanks for reporting!
Anh Tran
KeymasterIf you want to hide an element with your checkbox. This also can be done with Conditional Logic extension.
Anh Tran
KeymasterHi Jackky,
Thanks for the idea. It's a good idea. We haven't implemented that feature yet in the plugin. I'll try that ๐
Anh Tran
KeymasterI've checked and it works. Did you:
- Use the latest Builder version?
- Installed and activated Include/Exclude extension?Best regards,
Tan
Anh Tran
KeymasterHi,
I think you can do that by looping through the meta box definition and remove the fields when a condition happens. The idea is similar to this documentation. Please try it.
Anh Tran
KeymasterHi,
Unfortunately, there's no ways to setup 4 columns at the moment. The settings extension uses the WordPress layouts, which supports only 1 and 2 columns.
-
AuthorPosts