Changeset 5692
- Timestamp:
- 04/20/2015 04:40:37 PM (11 years ago)
- Location:
- branches/2.5/includes
- Files:
-
- 9 edited
-
admin/admin.php (modified) (2 diffs)
-
admin/metaboxes.php (modified) (10 diffs)
-
admin/replies.php (modified) (2 diffs)
-
admin/topics.php (modified) (2 diffs)
-
common/template.php (modified) (3 diffs)
-
replies/functions.php (modified) (1 diff)
-
replies/template.php (modified) (1 diff)
-
topics/functions.php (modified) (1 diff)
-
topics/template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/2.5/includes/admin/admin.php
r5630 r5692 510 510 // Settings page link 511 511 if ( current_user_can( 'bbp_settings_page' ) ) { 512 $new_links['settings'] = '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php') ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>';512 $new_links['settings'] = '<a href="' . esc_url( add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>'; 513 513 } 514 514 515 515 // About page link 516 516 if ( current_user_can( 'bbp_about_page' ) ) { 517 $new_links['about'] = '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php') ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>';517 $new_links['about'] = '<a href="' . esc_url( add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>'; 518 518 } 519 519 … … 541 541 */ 542 542 public function admin_bar_about_link( $wp_admin_bar ) { 543 544 543 if ( is_user_logged_in() ) { 545 546 544 $wp_admin_bar->add_menu( array( 547 545 'parent' => 'wp-logo', -
branches/2.5/includes/admin/metaboxes.php
r5630 r5692 51 51 if ( current_user_can( 'publish_forums' ) ) { 52 52 $link = add_query_arg( array( 'post_type' => bbp_get_forum_post_type() ), get_admin_url( null, 'edit.php' ) ); 53 $num = '<a href="' . $link. '">' . $num . '</a>';54 $text = '<a href="' . $link. '">' . $text . '</a>';53 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 54 $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 55 55 } 56 56 ?> … … 68 68 if ( current_user_can( 'publish_topics' ) ) { 69 69 $link = add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit.php' ) ); 70 $num = '<a href="' . $link. '">' . $num . '</a>';71 $text = '<a href="' . $link. '">' . $text . '</a>';70 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 71 $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 72 72 } 73 73 ?> … … 85 85 if ( current_user_can( 'publish_replies' ) ) { 86 86 $link = add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), get_admin_url( null, 'edit.php' ) ); 87 $num = '<a href="' . $link. '">' . $num . '</a>';88 $text = '<a href="' . $link. '">' . $text . '</a>';87 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 88 $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 89 89 } 90 90 ?> … … 104 104 if ( current_user_can( 'manage_topic_tags' ) ) { 105 105 $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) ); 106 $num = '<a href="' . $link. '">' . $num . '</a>';107 $text = '<a href="' . $link. '">' . $text . '</a>';106 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 107 $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 108 108 } 109 109 ?> … … 136 136 if ( current_user_can( 'edit_users' ) ) { 137 137 $link = get_admin_url( null, 'users.php' ); 138 $num = '<a href="' . $link. '">' . $num . '</a>';139 $text = '<a href="' . $link. '">' . $text . '</a>';138 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 139 $text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>'; 140 140 } 141 141 ?> … … 157 157 $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 158 158 } 159 $num = '<a href="' . $link. '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>';160 $text = '<a class="waiting" href="' . $link. '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>';159 $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $num . '</a>'; 160 $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_topic_title'] ) . '">' . $text . '</a>'; 161 161 ?> 162 162 … … 179 179 $link = add_query_arg( array( 'post_status' => bbp_get_spam_status_id() ), $link ); 180 180 } 181 $num = '<a href="' . $link. '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>';182 $text = '<a class="waiting" href="' . $link. '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>';181 $num = '<a href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $num . '</a>'; 182 $text = '<a class="waiting" href="' . esc_url( $link ) . '" title="' . esc_attr( $r['hidden_reply_title'] ) . '">' . $text . '</a>'; 183 183 ?> 184 184 … … 198 198 $text = _n( 'Empty Topic Tag', 'Empty Topic Tags', $r['empty_topic_tag_count'], 'bbpress' ); 199 199 $link = add_query_arg( array( 'taxonomy' => bbp_get_topic_tag_tax_id(), 'post_type' => bbp_get_topic_post_type() ), get_admin_url( null, 'edit-tags.php' ) ); 200 $num = '<a href="' . $link. '">' . $num . '</a>';201 $text = '<a class="waiting" href="' . $link. '">' . $text . '</a>';200 $num = '<a href="' . esc_url( $link ) . '">' . $num . '</a>'; 201 $text = '<a class="waiting" href="' . esc_url( $link ) . '">' . $text . '</a>'; 202 202 ?> 203 203 … … 457 457 <strong class="label"><?php esc_html_e( 'Topic:', 'bbpress' ); ?></strong> 458 458 <label class="screen-reader-text" for="parent_id"><?php esc_html_e( 'Topic', 'bbpress' ); ?></label> 459 <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative') ), 'bbp_suggest_topic_nonce' ); ?>" />459 <input name="parent_id" id="bbp_topic_id" type="text" value="<?php echo esc_attr( $reply_topic_id ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_topic' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_topic_nonce' ); ?>" /> 460 460 </p> 461 461 … … 516 516 <strong class="label"><?php esc_html_e( 'ID:', 'bbpress' ); ?></strong> 517 517 <label class="screen-reader-text" for="bbp_author_id"><?php esc_html_e( 'ID', 'bbpress' ); ?></label> 518 <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative') ), 'bbp_suggest_user_nonce' ); ?>" />518 <input type="text" id="bbp_author_id" name="post_author_override" value="<?php echo esc_attr( bbp_get_global_post_field( 'post_author' ) ); ?>" data-ajax-url="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'bbp_suggest_user' ), admin_url( 'admin-ajax.php', 'relative' ) ) ), 'bbp_suggest_user_nonce' ); ?>" /> 519 519 </p> 520 520 -
branches/2.5/includes/admin/replies.php
r5040 r5692 593 593 * @uses bbp_get_forum_permalink() To get the forum permalink 594 594 * @uses admin_url() To get the admin url of post.php 595 * @uses add_query_arg() To add custom args to the url596 595 * @uses apply_filters() Calls 'reply_topic_forum_row_actions' with an 597 596 * array of reply topic forum actions … … 746 745 if ( bbp_get_trash_status_id() === $reply->post_status ) { 747 746 $post_type_object = get_post_type_object( bbp_get_reply_post_type() ); 748 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";747 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>"; 749 748 } elseif ( EMPTY_TRASH_DAYS ) { 750 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";749 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>"; 751 750 } 752 751 753 752 if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) { 754 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";753 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>"; 755 754 } elseif ( bbp_get_spam_status_id() === $reply->post_status ) { 756 755 unset( $actions['trash'] ); -
branches/2.5/includes/admin/topics.php
r5073 r5692 655 655 * @uses bbp_get_forum_permalink() To get the forum permalink 656 656 * @uses admin_url() To get the admin url of post.php 657 * @uses add_query_arg() To add custom args to the url658 657 * @uses bbp_topic_reply_count() To output the topic reply count 659 658 * @uses bbp_topic_voice_count() To output the topic voice count … … 816 815 if ( bbp_get_trash_status_id() === $topic->post_status ) { 817 816 $post_type_object = get_post_type_object( bbp_get_topic_post_type() ); 818 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>";817 $actions['untrash'] = "<a title='" . esc_attr__( 'Restore this item from the Trash', 'bbpress' ) . "' href='" . esc_url( wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID ) ) . "'>" . esc_html__( 'Restore', 'bbpress' ) . "</a>"; 819 818 } elseif ( EMPTY_TRASH_DAYS ) { 820 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>";819 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr__( 'Move this item to the Trash', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID ) ) ) . "'>" . esc_html__( 'Trash', 'bbpress' ) . "</a>"; 821 820 } 822 821 823 822 if ( bbp_get_trash_status_id() === $topic->post_status || !EMPTY_TRASH_DAYS ) { 824 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>";823 $actions['delete'] = "<a class='submitdelete' title='" . esc_attr__( 'Delete this item permanently', 'bbpress' ) . "' href='" . esc_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $topic->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'bbpress' ) . "</a>"; 825 824 } elseif ( bbp_get_spam_status_id() === $topic->post_status ) { 826 825 unset( $actions['trash'] ); -
branches/2.5/includes/common/template.php
r5247 r5692 1135 1135 * @since bbPress (r2815) 1136 1136 * 1137 * @param string $ urlPass a URL to redirect to1137 * @param string $args Pass a URL to redirect to 1138 1138 * @uses add_query_arg() To add a arg to the url 1139 1139 * @uses site_url() Toget the site url … … 1141 1141 */ 1142 1142 function bbp_wp_login_action( $args = '' ) { 1143 1144 // Parse arguments against default values 1145 $r = bbp_parse_args( $args, array( 1146 'action' => '', 1147 'context' => '' 1148 ), 'login_action' ); 1149 1150 // Add action as query arg 1151 if ( !empty( $r['action'] ) ) { 1152 $login_url = add_query_arg( array( 'action' => $r['action'] ), 'wp-login.php' ); 1153 1154 // No query arg 1155 } else { 1156 $login_url = 'wp-login.php'; 1143 echo esc_url( bbp_wp_login_action( $args ) ); 1144 } 1145 1146 /** 1147 * return the login form action url 1148 * 1149 * @since bbPress (r5691) 1150 * 1151 * @param string $args Pass a URL to redirect to 1152 * @uses add_query_arg() To add a arg to the url 1153 * @uses site_url() Toget the site url 1154 * @uses apply_filters() Calls 'bbp_wp_login_action' with the url and args 1155 */ 1156 function bbp_get_wp_login_action( $args = '' ) { 1157 1158 // Parse arguments against default values 1159 $r = bbp_parse_args( $args, array( 1160 'action' => '', 1161 'context' => '', 1162 'url' => 'wp-login.php' 1163 ), 'login_action' ); 1164 1165 // Add action as query arg 1166 if ( !empty( $r['action'] ) ) { 1167 $login_url = add_query_arg( array( 'action' => $r['action'] ), $r['url'] ); 1168 1169 // No query arg 1170 } else { 1171 $login_url = $r['url']; 1172 } 1173 1174 $login_url = site_url( $login_url, $r['context'] ); 1175 1176 return apply_filters( 'bbp_wp_login_action', $login_url, $r, $args ); 1157 1177 } 1158 1159 $login_url = site_url( $login_url, $r['context'] );1160 1161 echo apply_filters( 'bbp_wp_login_action', $login_url, $r );1162 }1163 1178 1164 1179 /** … … 1188 1203 1189 1204 // Remove loggedout query arg if it's there 1190 $redirect_to = (string) esc_attr( remove_query_arg( 'loggedout', $redirect_to ));1191 $redirect_field = '<input type="hidden" id="bbp_redirect_to" name="redirect_to" value="' . $redirect_to. '" />';1205 $redirect_to = remove_query_arg( 'loggedout', $redirect_to ); 1206 $redirect_field = '<input type="hidden" id="bbp_redirect_to" name="redirect_to" value="' . esc_url( $redirect_to ) . '" />'; 1192 1207 1193 1208 echo apply_filters( 'bbp_redirect_to_field', $redirect_field, $redirect_to ); -
branches/2.5/includes/replies/functions.php
r5377 r5692 1496 1496 * and action 1497 1497 * @uses bbp_get_reply_url() To get the reply url 1498 * @uses add_query_arg() To add custom args to the reply url1499 1498 * @uses wp_safe_redirect() To redirect to the reply 1500 1499 * @uses bbPress::errors:add() To log the error messages -
branches/2.5/includes/replies/template.php
r5377 r5692 459 459 * 460 460 * @param int $reply_id Optional. Reply id 461 * @param $string $redirect_to Optional. Pass a redirect value for use with461 * @param string $redirect_to Optional. Pass a redirect value for use with 462 462 * shortcodes and other fun things. 463 463 * @uses bbp_get_reply_id() To get the reply id -
branches/2.5/includes/topics/functions.php
r5377 r5692 2052 2052 * @uses bbp_get_forum_permalink() To get the forum link 2053 2053 * @uses bbp_get_topic_permalink() To get the topic link 2054 * @uses add_query_arg() To add args to the url2055 2054 * @uses wp_safe_redirect() To redirect to the topic 2056 2055 * @uses bbPress::errors:add() To log the error messages -
branches/2.5/includes/topics/template.php
r5237 r5692 2094 2094 * @uses current_user_can() To check if the current user can edit others 2095 2095 * replies 2096 * @uses add_query_arg() To add custom args to the url2097 2096 * @uses apply_filters() Calls 'bbp_get_topic_replies_link' with the 2098 2097 * replies link and topic id
Note: See TracChangeset
for help on using the changeset viewer.