Events plugin for theater (event = performance of a production)

Note upfront: This is no answer, just a list of things to consider: Lets say you got one event called “Hamlet”. Then it gets played every Friday. Times: 16:30-18:30 19:00-21:00 12:00-14:30 (kids performance with a break in between so it’s 30min longer) Then there’s the other problem is that it could be played for three … Read more

Removing WordPress Plugin Menu Item for a specific user

Here is the code you need: global $current_user; get_currentuserinfo(); if ( $current_user->user_login === ‘brian’ ) remove_action( ‘admin_menu’, ‘wpcf7_admin_menu’, 9 ); Or if you want to retain your own code, use this: function remove_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == ‘brian’) { $restricted = array(__(‘Media’), __(‘Links’), __(‘Pages’), __(‘Comments’), __(‘Appearance’), __(‘Plugins’), __(‘Users’), __(‘Tools’), __(‘Settings’), __(‘Contact’) … Read more

Can plugin variables cause conflict?

They can. Say you have plugin one, with only this: // Plugin one $variable = “henk”; And then you have plugin two, with only this: // Plugin two echo $variable; And now you activate these plugins, you will probably see the variable of plugin one echo’d by plugin two (at least it did here, but … Read more

How do I change the default WordPress e-mail ID for sent e-mail?

Add the following to your functions.php: add_filter(‘wp_mail_from’, ‘new_mail_from’); add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’); function new_mail_from($old) { return ‘your email address’; } function new_mail_from_name($old) { return ‘your name or your website’; }

How to add a privacy-checkbox in comment-template?

You can use the provided filters to do all that: //add your checkbox after the comment field add_filter( ‘comment_form_field_comment’, ‘my_comment_form_field_comment’ ); function my_comment_form_field_comment( $comment_field ) { return $comment_field.'<input type=”checkbox” name=”privacy” value=”privacy-key” class=”privacyBox” aria-req=”true”><p class=”pprivacy”>Hiermit akzeptiere ich die <a target=”blank” href=”http://wp.cloudstarter.de/?page_id=156″>Datenschutzbedingungen</a><p>’; } //javascript validation add_action(‘wp_footer’,’valdate_privacy_comment_javascript’); function valdate_privacy_comment_javascript(){ if (is_single() && comments_open()){ wp_enqueue_script(‘jquery’); ?> <script type=”text/javascript”> jQuery(document).ready(function($){ … Read more

How to check if WordPress is updating plugins?

Instead of re-ordering your plugins to load in a specific order, have each of them that requires some other plugin to be loaded to defer their initialization until the “plugins_loaded” action hook. In other words, when a plugin with a dependency is included and ran, it shouldn’t do anything directly. Instead, it should have functions, … Read more

Dropzone.js and wordpress plugin

I assume the issue is that your form targets an external file, where WordPress isn’t properly loaded to access the API. WordPress has a handler built in that you can use to process POST requests, via the admin_post action: Example form with hidden action field: <form action=”<?php echo admin_url( ‘admin-post.php’ ); ?>” method=”post”> <input type=”hidden” … Read more