This file contains 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 | |
/** | |
* ACF Pro repeater field shortcode | |
* | |
* I created this shortcode function because it didn't exist and it was being requested by others | |
* I originally posted it here: https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/ | |
* | |
* @attr {string} field - (Required) the name of the field that contains a repeater sub group | |
* @attr {string} sub_fields - (Required) a comma separated list of sub field names that are part of the field repeater group | |
* @attr {string} post_id - (Optional) Specific post ID where your value was entered. Defaults to current post ID (not required). This can also be options / taxonomies / users / etc |
This file contains 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
/** | |
* WordPress Blocks | |
* | |
* Default block styling included with WordPress core. | |
* Provides a better starting point for WordPress theme developers, | |
* especially when using Sass. | |
* | |
* @link https://github.com/WordPress/WordPress/blob/master/wp-includes/css/dist/block-library/style.css | |
* | |
* Most styles from the above file are included. |
This file contains 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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
This file contains 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
/** | |
* How to link into the WordPress Customizer | |
*/ | |
Simple Link: | |
<a href="<?php echo esc_url( admin_url( 'customize.php' ) ); ?>">Link to Customizer</a> | |
Link to Panel: | |
$query['autofocus[panel]'] = 'nav_menus'; |
This file contains 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
add_action( 'gform_user_registered','we_autologin_gfregistration', 10, 4 ); | |
/** | |
* Auto login to site after GF User Registration Form Submittal | |
* | |
*/ | |
function we_autologin_gfregistration( $user_id, $config, $entry, $password ) { | |
wp_set_auth_cookie( $user_id, false, '' ); | |
} |
This file contains 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 | |
/** | |
* Redirects subscribers back to the home page if they attempt to access the dashboard. | |
*/ | |
function prefix_redirect_admin() { | |
if ( ! current_user_can( 'edit_posts' ) && ! defined( 'DOING_AJAX' ) ) { | |
wp_safe_redirect( home_url() ); | |
exit; | |
} | |
} |
This file contains 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
.wp-video, video.wp-video-shortcode, .mejs-container, .mejs-overlay.load { | |
width: 100% !important; | |
height: 100% !important; | |
} | |
.mejs-container { | |
padding-top: 56.25%; | |
} | |
.wp-video, video.wp-video-shortcode { | |
max-width: 100% !important; | |
} |
This file contains 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 | |
/** | |
* Disables the #wpadmin bar for users without "edit_posts" permissions. | |
*/ | |
function prefix_hide_admin_bar() { | |
if ( ! current_user_can( 'edit_posts' ) ) { | |
add_filter( 'show_admin_bar', '__return_false' ); | |
} | |
} | |
add_action( 'after_setup_theme', 'prefix_hide_admin_bar' ); |
This file contains 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
/** | |
* Javacript for loading custom Google Analytics events | |
* | |
* @since 1.0.0 | |
*/ | |
(function($) { | |
// GA Docs for Social Interactions: | |
// https://developers.google.com/analytics/devguides/collection/analyticsjs/social-interactions |
NewerOlder