eran_catom
Forum Replies Created
-
Forum: Plugins
In reply to: [Members - Membership & User Role Editor Plugin] Redirect after loginadd this to your functions.php, it will redirect the users (who can’t manage options) to the home page of the website instead of the admin panel.
add_action('admin_init', 'no_mo_dashboard'); function no_mo_dashboard() { if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') { wp_redirect(home_url()); exit; } }
source: https://werdswords.com/howto-disable-access-to-the-wordpress-dashboard-for-non-admins/
Forum: Plugins
In reply to: [Quick Flag] How to remove parentheses around the flagshi,
i had the same problem but i’ve thought about possible solution, maybe it’s not the best but it’s working…
i wanted to get only the country but i didn’t want to touch the plugin code so in my function.php file i’ve created this:
function getCountry(){ $quick_flag = do_shortcode('[quick-flag]'); $country = substr($quick_flag, 0, strpos($quick_flag, '(')); $country = str_replace(' ','', $country); echo $country; }
the function is trimming everything in the output string from ‘(‘ (the flag and the brackets), remove spaces and echo the country so all we need to do now is call it where we like to.
if you’r looking for a shortcode to use in the admin panel so we can add new shortcode:
function new_quick_flag() { $quick_flag = do_shortcode('[quick-flag]'); $country = substr($quick_flag, 0, strpos($quick_flag, '(')); $country = str_replace(' ','', $country); return $country; } add_shortcode( 'quick-country', 'new_quick_flag' );
put
[quick-country]
where you like to.hope this helped,
eranForum: Plugins
In reply to: [Contact Form 7] change email target in the shortcode itselfThanks @buzztone it’s perfect!
if someone need the same, i found this link very helpful:
https://sevenspark.com/wordpress-plugins/how-to-dynamically-set-the-recipient-to-email-address-in-contact-form-7