This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //get ajax url | |
| $ajax_url = admin_url( 'admin-ajax.php' ); | |
| //localize script | |
| wp_localize_script( 'script-handle-name', 'js_object', [ | |
| //js value | |
| 'ajax_url' => $ajax_url, | |
| 'other_value' => 'values' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Allow subscribers to see Private posts and pages | |
| $subRole = get_role( 'subscriber' ); | |
| $subRole->add_cap( 'read_private_posts' ); | |
| $subRole->add_cap( 'read_private_pages' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Redirect to home page on login | |
| function login_redirect( $redirect_to, $request_redirect_to, $user ) { | |
| if ( is_a( $user, 'WP_User' ) && $user->has_cap( 'edit_posts' ) === false ) { | |
| return get_bloginfo( 'siteurl' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "<vendor_name>/<package_name>", | |
| "description": "<description>", | |
| "type": "project", | |
| "license": "GPL", | |
| "authors": [ | |
| { | |
| "name": "<author>", | |
| "email": "<email>" | |
| } |