Duplicate Posts and Pages (copy)

// Add the duplicate link to action list for post_row_actions // for “post” and custom post types add_filter( ‘post_row_actions’, ‘rd_duplicate_post_link’, 10, 2 ); // for “page” post type add_filter( ‘page_row_actions’, ‘rd_duplicate_post_link’, 10, 2 ); function rd_duplicate_post_link( $actions, $post ) {…Continue reading

Duplicate Posts and Pages (copy)

// Add the duplicate link to action list for post_row_actions // for “post” and custom post types add_filter( ‘post_row_actions’, ‘rd_duplicate_post_link’, 10, 2 ); // for “page” post type add_filter( ‘page_row_actions’, ‘rd_duplicate_post_link’, 10, 2 ); function rd_duplicate_post_link( $actions, $post ) {…Continue reading

VIsual Campaign Builder: Add HTML Tags To Display In The HTML/CODE Block

add_filter( ‘charitable_campaign_builder_html_allowed_tags’, ‘example_charitable_add_html_tags_to_html_visual_builder’, 10, 2 ); function example_charitable_add_html_tags_to_html_visual_builder( $allowed_html = array(), $campaign ) { // this replaces the default allowed tags with the following. Add or remove tags (and attributes) as needed. $allowed_html = array( ‘a’ => [ ‘href’ =>…Continue reading

Change Arabic Currency symbol to the currency short code

/** * change arabic currency symbol to short Currency name for AED, SAR, QAR , BHD , OMR , KWD */ add_filter( ‘woocommerce_currency_symbol’, ‘wc_change_uae_currency_symbol’, 10, 2 ); function wc_change_uae_currency_symbol( $currency_symbol, $currency ) { switch ( $currency ) { case ‘AED’:…Continue reading

Add Autofocus on Your Form

/* Add autofocus to the first form field of the form Original doc link: https://wpforms.com/developers/how-to-add-autofocus-on-your-form/ For support, please visit: https://www.facebook.com/groups/wpformsvip */ function wpf_dev_autofocus() { ?>Continue reading

Show WordPress Messages only in Dashboard

function render_system_notices_page() { echo ‘ ‘; echo ‘ Systemmeldungen ‘; echo ‘ ‘; do_action( ‘admin_notices’ ); } function register_system_notices_submenu_page() { add_submenu_page( ‘index.php’, // Slug des Hauptmenüs (Dashboard) ‘Systemmeldungen’, ‘Systemmeldungen’, ‘manage_options’, ‘system-notices’, ‘render_system_notices_page’ ); } add_action(‘admin_menu’, ‘register_system_notices_submenu_page’); function move_plugin_notices_to_custom_view() { global…Continue reading

Minimize Admin Bar

function replace_admin_bar_text() { global $wp_admin_bar; $wp_admin_bar->add_node(array( ‘id’ => ‘my-account’, ‘title’ => ‘👤‘, ‘href’ => get_edit_profile_url(), )); } add_action(‘wp_before_admin_bar_render’, ‘replace_admin_bar_text’, 0); function remove_comments() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘comments’); } add_action(‘wp_before_admin_bar_render’, ‘remove_comments’, 0); function remove_new_menu() { global $wp_admin_bar; $wp_admin_bar->remove_menu(‘new-content’); } add_action(‘wp_before_admin_bar_render’, ‘remove_new_menu’, 0);Continue reading

Disable WP options if editor

function remove_pages_from_menu() { if ( current_user_can( ‘editor’ ) ) { remove_menu_page( ‘edit-comments.php’ ); remove_menu_page( ‘edit.php’ ); remove_menu_page( ‘edit.php?post_type=page’ ); remove_menu_page( ‘edit.php?post_type=jet-theme-core’ ); remove_menu_page( ‘tools.php’ ); remove_menu_page( ‘edit.php?post_type=jet-popup’ ); remove_menu_page( ‘edit.php?post_type=jet-form-builder’ ); } } add_action( ‘admin_menu’, ‘remove_pages_from_menu’ ); function remove_link_from_admin_bar( $wp_admin_bar…Continue reading