Skip to content

Commit

Permalink
Move the scheduled values value to Pro; add action documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Jan 29, 2025
1 parent b40a1ee commit 601ec79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/css/post-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

#wp2t h3 {
margin: 0;
margin: 0 0 .5rem;
font-size: .9rem;
}

Expand Down
11 changes: 9 additions & 2 deletions src/includes/metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ function wpt_add_twitter_inner_box( $post ) {
<?php
// XPoster Pro.
if ( 'pro' === $is_pro && ( current_user_can( 'wpt_twitter_custom' ) || current_user_can( 'manage_options' ) ) ) {
wpt_schedule_values( $post->ID );
/**
* Display the custom tab container in XPoster Pro.
*
* @hook wpt_custom_tab
*
* @param int $post_ID Post ID.
* @param string $visibility 'visible' or 'hidden'.
*/
do_action( 'wpt_custom_tab', $post->ID, 'visible' );
if ( current_user_can( 'edit_others_posts' ) ) {
if ( '1' === get_option( 'jd_individual_twitter_users' ) ) {
Expand All @@ -157,7 +164,7 @@ function wpt_add_twitter_inner_box( $post ) {
<p><?php esc_html_e( 'Customizing XPoster options is not allowed for your user role.', 'wp-to-twitter' ); ?></p>
<?php
if ( 'pro' === $is_pro ) {
wpt_schedule_values( $post->ID, 'hidden' );
// Documented above.
do_action( 'wpt_custom_tab', $post->ID, 'hidden' );
}
}
Expand Down

0 comments on commit 601ec79

Please sign in to comment.