Пример #1
0
/**
 * Template tags.
 *
 * @package P2
 * @since unknown
 */

function p2_body_class( $classes ) {
	if ( is_tax( P2_MENTIONS_TAXONOMY ) )
		$classes[] = 'mentions';
	if ( p2_is_iphone() )
		$classes[] = 'iphone';
	return $classes;
}
Пример #2
0
 static function enqueue_scripts()
 {
     global $wp_locale;
     // Generate dependencies for p2
     $depends = array('jquery', 'utils', 'jquery-color', 'comment-reply', 'scrollit', 'wp-locale', 'p2-spin');
     if (is_user_logged_in()) {
         $depends[] = 'jeditable';
         $depends[] = 'jquery-ui-autocomplete-html';
         $depends[] = 'jquery-ui-autocomplete-multiValue';
         $depends[] = 'jquery-ui-autocomplete-match';
         // media upload
         if (is_home()) {
             $depends[] = 'media-upload';
         }
     }
     // Enqueue P2 JS
     wp_enqueue_script('p2js', P2_JS_URL . '/p2.js', $depends, '20140603');
     wp_localize_script('p2js', 'p2txt', array('tags' => '<br />' . __('Tags:', 'p2'), 'tagit' => __('Tag it', 'p2'), 'citation' => __('Citation', 'p2'), 'title' => __('Post Title', 'p2'), 'goto_homepage' => __('Go to homepage', 'p2'), 'n_new_updates' => __('%d new update(s)', 'p2'), 'n_new_comments' => __('%d new comment(s)', 'p2'), 'jump_to_top' => __('Jump to top', 'p2'), 'not_posted_error' => __('An error has occurred, your post was not posted', 'p2'), 'update_posted' => __('Your update has been posted', 'p2'), 'loading' => __('Loading...', 'p2'), 'cancel' => __('Cancel', 'p2'), 'save' => __('Save', 'p2'), 'hide_threads' => __('Hide threads', 'p2'), 'show_threads' => __('Show threads', 'p2'), 'unsaved_changes' => __('Your comments or posts will be lost if you continue.', 'p2'), 'date_time_format' => __('%1$s <em>on</em> %2$s', 'p2'), 'date_format' => get_option('date_format'), 'time_format' => get_option('time_format'), 'l10n_print_after' => 'try{convertEntities(p2txt);}catch(e){};', 'autocomplete_prompt' => __('After typing @, type a name or username to find a member of this site', 'p2'), 'no_matches' => __('No matches.', 'p2'), 'comment_cancel_ays' => __('Are you sure you would like to clear this comment? Its contents will be deleted.', 'p2'), 'oops_not_logged_in' => __('Oops! Looks like you are not logged in.', 'p2'), 'please_log_in' => __('Please log in again', 'p2'), 'whoops_maybe_offline' => __('Whoops! Looks like you are not connected to the server. P2 could not connect with WordPress.', 'p2'), 'required_filed' => __('This field is required.', 'p2')));
     if (p2_is_iphone()) {
         wp_enqueue_script('iphone', get_template_directory_uri() . '/js/iphone.js', array('jquery'), '20120402', true);
     }
     add_action('wp_head', array('P2_JS', 'locale_script_data'), 2);
 }
Пример #3
0
/**
 * iPhone Stylesheet.
 *
 * Hooks into the wp_enqueue_styles action late.
 *
 * @uses p2_is_iphone()
 * @since P2 1.4
 */
function p2_iphone_style() {
	if ( p2_is_iphone() ) {
		wp_enqueue_style(
			'p2-iphone-style',
			get_template_directory_uri() . '/style-iphone.css',
			array(),
			'20120402'
		);
	}
}