plugin_directory . 'facebook.php' ), array( 'jquery-ui-autocomplete' ), '1.3', true ); wp_enqueue_style( 'facebook-mentions', plugins_url( 'static/css/admin/mentions' . $suffix . '.css', $facebook_loader->plugin_directory . 'facebook.php' ), array(), '1.3' ); } /** * Add content to the profile publisher meta box * * @since 1.0 * * @global WP_Locale $wp_locale display Like counts in the number format of the current locale * @param stdClass $post current post * @return void */ public static function content( $post ) { global $wp_locale; if ( ! isset( $post->ID ) ) return; // Use nonce for verification wp_nonce_field( plugin_basename( __FILE__ ), self::NONCE_NAME ); $feature_enabled = true; if ( get_post_meta( $post->ID, self::POST_META_KEY_FEATURE_ENABLED, true ) === '0' ) $feature_enabled = false; echo '

'; $field_message_id = 'facebook-timeline-mention-message'; echo '
ID, self::POST_META_KEY_MESSAGE, true ); if ( $stored_message ) echo ' value="' . esc_attr( $stored_message ) . '"'; echo ' />

'; if ( ! class_exists( 'Facebook_Social_Publisher_Settings' ) ) require_once( dirname( dirname( __FILE__ ) ) . '/settings-social-publisher.php' ); if ( get_option( Facebook_Social_Publisher_Settings::OPTION_OG_ACTION ) ) { // set JavaScript properties for localized text echo ''; } echo '
'; } /** * Save the custom Status, used when posting to a User's Timeline. * * @since 1.0 * * @param int $post_id WordPress post identifier * @global void */ public static function save( $post_id ) { // verify if this is an auto save routine. // If it is our form has not been submitted, so we dont want to do anything if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( ! isset( $_POST[self::FIELD_MESSAGE] ) || empty( $_POST[self::NONCE_NAME] ) || ! wp_verify_nonce( $_POST[self::NONCE_NAME], plugin_basename( __FILE__ ) ) ) return; // Check permissions $post_type = get_post_type( $post_id ); if ( ! ( $post_type && post_type_supports( $post_type, 'author' ) ) ) return; if ( ! class_exists( 'Facebook_Social_Publisher' ) ) require_once( dirname(__FILE__) . '/social_publisher.php' ); $capability_singular_base = Facebook_Social_Publisher::post_type_capability_base( $post_type ); if ( ! current_user_can( 'edit_' . $capability_singular_base, $post_id ) ) return; $feature_enabled = '1'; if ( ! isset( $_POST[self::FIELD_FEATURE_ENABLED] ) || $_POST[self::FIELD_FEATURE_ENABLED] === '0' ) $feature_enabled = '0'; update_post_meta( $post_id, self::POST_META_KEY_FEATURE_ENABLED, $feature_enabled ); unset( $feature_enabled ); $message = trim( sanitize_text_field( $_POST[self::FIELD_MESSAGE] ) ); if ( $message ) update_post_meta( $post_id, self::POST_META_KEY_MESSAGE, $message ); } } ?>