Manuel Schmalstieg
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields (ACF?)] Why code in header.php is not working?Instead of this:
the_field(‘header_script');
try this:
the_field('header_script');
Somehow, your text editor has replaced a ‘straight’ apostrophe by a ‘curly’ one. A small difference, but it’s enough to prevent code from working.
You can actually see how it messes up the syntax coloring in the image you posted.
Thanks for the follow-up!
So this confirms my assumptions that putting the filter in a plugin won’t work. That’s good to know – the documentation didn’t make it entirely clear, and the message in Jetpack’s dashboard was misleading.
Not sure if this a bug, or if the filter works only in a plugin, not in a theme’s functions.php ?
Indeed, this appears to be the case: the filter has no effect when run in functions.php of a theme, but works when running inside a functionality plugin.
I’m confirming the issue reported by terranovamarina18, occurring with WP 4.5.2 and Jetpack 4.0.2. I’m using two functionalities: Carousel and Tiled Galleries.
The observed behavior is different, according to the method of triggering the “development mode”, as explained here:
https://jetpack.com/support/development-mode/If the development mode is set in
wp-config.php
with the linedefine( 'JETPACK_DEV_DEBUG', true);
, then both Carousel and Tiled Galleries work fine.It’s different if the development mode is set in the theme’s
functions.php
, with the filteradd_filter( 'jetpack_development_mode', '__return_true' );
.Jetpack seems fine, it says “In Development Mode, via the jetpack_development_mode filter.”, and I can activate the Carousel and Tiled Galleries on the Jetpack Settings page.
However, neither Carousel nor Tiled Galleries are working.
Not sure if this a bug, or if the filter works only in a plugin, not in a theme’s functions.php ?
Forum: Plugins
In reply to: [WP User Groups] Group pages and member listings?Did you try it?
I think this plugin would fulfill your need: the user groups are nothing else than a WordPress taxonomy, every user-group is a taxonomy term, which supports title / description … and since WP 4.4 gave us Term Meta, you can even add custom fields to them!
Forum: Plugins
In reply to: [WP User Groups] Listing users by groupFor the record, my method for doing this is to use
get_objects_in_term
.Code sample:
$ids_of_complete_users = get_objects_in_term( 42, // id of group 'user-group' ); // then if (!empty($ids_of_complete_users)) { $user_query = new WP_User_Query( array( 'include' => $ids_of_complete_users, 'orderby' => 'registered', 'order' => 'DESC' ) ); if ( !empty( $user_query->results ) ) { foreach ( $user_query->results as $user ) { // display what is needed } } }
I’m encountering a similar issue, though I’m using a Google Calendar, not a grouped calendar.
I followed the Timezone Settings instructions in detail, everywhere the timezone is set to UTC+2. In the displayed calendar, all events are off by one hour, e.g. 10:00 instead of 09:00.
Running Simple Calendar 3.0.16 on WP 4.5.1.
The only workaround I see is to offset the calendar’s timezone, setting it to UTC+1 instead of +2.
On my side, the workaround proposed by Marius works.
Forum: Plugins
In reply to: [Minimalistic Event Manager] Widget: Date in boldHi @uebe,
Sorry for the late reply, for some reason I didn’t get any notification.
To display the date in bold, you can add the following CSS to your theme:
.mem_event_list .post-date { font-weight: bold; }
To add custom CSS, you may use a plugin such as Jetpack, which has the “Custom CSS” functionality. Or maybe you use a child theme.
I hope this helps!
Forum: Plugins
In reply to: [Minimalistic Event Manager] widgetJust noting that this behavior is fixed in the current version (1.0.9).
Forum: Plugins
In reply to: [User Groups] Admin is "not allowed to manage these items"Lisa, I can confirm that Asgaros information is correct, by adding
'show_ui' => true
the problem is solved.Here’s a clearer way on how to add that line. I suggest to add it after line 314 (in the current version as of January 2016):
The original code looks like this:
array( 'public' => false, 'labels' => array(
Add your new line after
'public' => false
, like this:array( 'public' => false, 'show_ui' => true, 'labels' => array(
After that, you will be able to access the admin area.
Kudos to you for taking a dive into PHP editing while being just a user ??
Forum: Plugins
In reply to: [WP User Groups] Applying Bulk Action should preserve current viewNote: I made a basic attempt by replacing the following line:
wp_safe_redirect( admin_url( 'users.php' ) );
with this:
wp_safe_redirect( wp_get_referer() );
… but the redirect doesn’t work, it produces a white screen on redirect (the bulk action gets applied though).
Forum: Plugins
In reply to: [WP User Groups] How to hide user-groups from subscribers?Update: working solution found:
function myprefix_limit_group_access() { global $wp_taxonomies; $wp_taxonomies['user-group']->cap->assign_terms = 'list_users'; } add_action('init','myprefix_limit_group_access', 11);
Not sure if it’s the official way, but it works!
Forum: Plugins
In reply to: [WP User Groups] How to hide user-groups from subscribers?Update: it looks like the capabilities for the user group taxonomies are assigned like this:
'capabilities' => array( 'manage_terms' => 'list_users', 'edit_terms' => 'list_users', 'delete_terms' => 'list_users', 'assign_terms' => 'read', ),
What this means: the ‘manage_terms’, ‘edit_terms’ and ‘delete_terms’ actions require Administrator powers, while ‘assign_terms’ is given the ‘read’ level … which makes it available for Subscribers.
Forum: Plugins
In reply to: [WP User Groups] How to hide user-groups from subscribers?Looking a the source code, I see two possible strategies:
1) Change the capabilities of either the Subscriber role or the Groups taxonomy, so that the Subscriber doesn’t have the capability of assigning taxonomy terms to himself.
Here’s a relevant piece of code:
https://github.com/stuttter/wp-user-groups/blob/5c694600bc5984d279164b33bf386a9501e55bdb/includes/class-user-taxonomy.php#L268if ( ! current_user_can( 'edit_user', $user_id ) || ! current_user_can( $tax->cap->assign_terms ) ) { return; }
Interestingly, the Roles_and_Capabilities Codex page doesn’t mention
edit_user
, but onlyedit_users
.Update: according to wp-includes/capabilities.php#L39,
edit_user
is the capability that allows a user to edit itself – which explains why subscribers have access to it.2) Remove the action that adds the Groups UI to the profile page. I see some potential actions here:
add_action( 'show_user_profile', array( $this, 'edit_user_relationships' ), 99 ); add_action( 'edit_user_profile', array( $this, 'edit_user_relationships' ), 99 );
A difficulty here is that the $function_to_add argument is not a name, but an array… Here’s how the Codex defines the arguments of add_action:
add_action( $hook, $function_to_add, $priority, $accepted_args );