Changeset 10214 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 08/28/2020 05:36:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r10211 r10214 787 787 788 788 /** 789 * Generates a link to self-transfer a plugin. .789 * Generates a link to self-transfer a plugin. 790 790 * 791 791 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. … … 798 798 array( '_wpnonce' => wp_create_nonce( 'wp_rest' ) ), 799 799 home_url( 'wp-json/plugins/v1/plugin/' . $post->post_name . '/self-transfer' ) 800 ); 801 } 802 803 /** 804 * Generates a link to enable Release Confirmations. 805 * 806 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 807 * @return string URL to enable confirmations. 808 */ 809 public static function get_enable_release_confirmation_link( $post = null ) { 810 $post = get_post( $post ); 811 812 return add_query_arg( 813 array( '_wpnonce' => wp_create_nonce( 'wp_rest' ) ), 814 home_url( 'wp-json/plugins/v1/plugin/' . $post->post_name . '/release-confirmation' ) 815 ); 816 } 817 818 /** 819 * Generates a link to confirm a release. 820 * 821 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 822 * @return string URL to enable confirmations. 823 */ 824 public static function get_release_confirmation_link( $tag, $post = null) { 825 $post = get_post( $post ); 826 827 return add_query_arg( 828 array( '_wpnonce' => wp_create_nonce( 'wp_rest' ) ), 829 home_url( 'wp-json/plugins/v1/plugin/' . $post->post_name . '/release-confirmation/' . $tag ) 830 ); 831 } 832 833 /** 834 * Generates a link to email the release confirmation link. 835 * 836 * @param int|\WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 837 * @return string URL to enable confirmations. 838 */ 839 public static function get_release_confirmation_access_link() { 840 return add_query_arg( 841 array( '_wpnonce' => wp_create_nonce( 'wp_rest' ) ), 842 home_url( 'wp-json/plugins/v1/release-confirmation-access' ) 800 843 ); 801 844 }
Note: See TracChangeset
for help on using the changeset viewer.