What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-15 03:32:13
how to bound admin user to show selected menu on backend
add_action( 'admin_init', 'my_remove_menu_pages' ); function my_remove_menu_pages() { global $user_ID; if ( $user_ID == 3 ) { //select your user id remove_menu_page('edit.php'); // Posts remove_menu_page('upload.php'); // Media remove_men... Add solution -
PHP 2021-11-15 02:38:08
woocommerce action order complete
function mysite_woocommerce_order_status_completed( $order_id ) { error_log( "Order complete for order $order_id", 0 ); } add_action( 'woocommerce_order_status_completed', 'mysite_woocommerce_order_status_completed', 10, 1 ); Add solution -
Other 2021-11-14 21:44:17
wp rest api acf fields
function create_ACF_meta_in_REST() { $postypes_to_exclude = ['acf-field-group','acf-field']; $extra_postypes_to_include = ["page"]; $post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exc... Add solution -
Other 2021-11-14 05:38:23
wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/assets/css/bootstrap.min.css', [], time(), 'all' );
/** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', get_template_dir... Add solution -
Javascript 2021-11-13 21:08:11
wordpress ajax filter code
add_action('wp_ajax_myfilter', 'misha_filter_function'); // wp_ajax_{ACTION HERE} add_action('wp_ajax_nopriv_myfilter', 'misha_filter_function'); function misha_filter_function(){ $args = array( 'orderby' => 'date', // we will sort posts by ... Add solution -
Other 2021-11-11 22:57:13
wordpress required post admin title field
/** ADD Validation for title */ function force_post_title_init() { wp_enqueue_script('jquery'); } function force_post_title() { echo "<script type='text/javascript'>\n"; echo " jQuery('#publish').click(function()... Add solution -
Other 2021-11-11 21:27:22
woocommerce profile photo upload
// Add field function action_woocommerce_edit_account_form_start() { ?> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> <label for="image"><?php esc_html_e( 'Image', ... Add solution
Best helpers
Ranking is empty