Brandon Lavigne
Forum Replies Created
-
Forum: Plugins
In reply to: [WP Rollback - Rollback Plugins and Themes] Limit user accessHey dmori,
You’ll need to read about how WordPress handles User Roles and Capabilities. There is nothing preventing you from creating your own “Owner” role. From the code side you’ll still be referencing the capabilities you create for your client. Once you have the role and cap set up, you just need to look at the gist I shared and change line 6 to fit your needs.
Forum: Plugins
In reply to: [WP Rollback - Rollback Plugins and Themes] Limit user accessIt’s not anything we would need to add on our side. You could remove our actions based on however you determine they have access. Maybe a role capability you invented?
Here’s an untested gist you could try:
https://gist.github.com/drrobotnik/293f9aafd03bc7b51506Forum: Plugins
In reply to: [Breadcrumb NavXT] Add a filter to modify default opts.. wow. you are correct, I didn’t even see the options page.
Hi Andy,
Thanks for the insight. Yeah it does get a bit complex and I have a feeling different folks may want this different ways. This became apparent with mail service integrations.
In our case we want to parse out the information similarly to how it’s displayed on the dashboard. The only change I’d prefer is for checkgroup field types, instead of parsing these into their own fields with the values checked/unchecked, merge these into one comma separated key/value.
For example: ( checkgroup )
Alcohol Preference
[x] Rum
[x] Bourbon
[ ] Rye Whiskey
[ ] Single MaltCould merge to Alcohol Preference: Rum, Bourbon
Rad! Thanks for the follow-up.
Forum: Plugins
In reply to: manage_posts_custom_column not workingif your post type has hierarchical => true, then the custom columns don’t work. Try setting it to false and see if they work.
Just felt like adding to this since I ran into an instance where I needed my custom post type to be hierarchical to use wp_list_pages() with custom post types on the front end.
adding a conditional around is_admin() to check if you’re on the front end or the backend will solve this quirky bug.
add_action( 'init', 'create_post_type' ); function create_post_type() { if(is_admin()){$hier = false;}else{$hier = true;} register_post_type( 'projects', array( 'labels' => array( 'name' => __( 'Projects' ), 'singular_name' => __( 'Project' ), 'add_new_item' => __( 'Add New Project' ), 'edit_item' => __( 'Edit Project' ) ), 'public' => true, 'has_archive' => true, 'hierarchical' => $hier, 'rewrite' => array('slug' => 'project') ) ); }
I figured it out, it was an issue with my plugins folder not matching the folder in the enqeue_admin_scripts() function. I have network sites enabled, with each site having a separate plug-in folder. So, it was my fault. This plug-in is really great.
Lines changed:
public function enqueue_admin_scripts() { $darray = explode('.', $_SERVER['SERVER_NAME']); $unisite = $darray[0]; wp_enqueue_script("featured-image-custom", plugins_url('/'. $unisite . '/' . basename(dirname(__FILE__)) .'/js/multi-post-thumbnails-admin.js'), array('jquery'));
}
Side note, is there anyway to set up the plug-in to attach a metabox each time the user adds an image. I want to set it up so the user can add as many images as they want.
Functionality would go like this. User adds 2nd thumbnail image, 3rd thumbnail metabox appears, allowing them to add a third.
I’m turning the featured image into transition slide on the top of each page.
Forum: Fixing WordPress
In reply to: wp_nav_menu lacks basic featuresAh! They were turned off in the screen options by default.
Forum: Plugins
In reply to: [Plugin: Sociable] Doesn’t open in a _blank windowfind the line that says:
$link .= " href=\"javascript:window.location='".urlencode($url)."';\" title=\"$description\">";
and change it to:
$link .= ' href="'.$url.'" title="'.$description.'">';
I don’t understand why they chose to use javascript in a standard href, but this should fix it.
The only thing this doesn’t fix is that in Safari if you have a comma in the title it will lose all the following text. Anyone have a solution for this?
Forum: Fixing WordPress
In reply to: 2.8.1 CodePress Syntax Highlighting Removed?The bespin team is working on a solid browser based editor. It’d be cool to see it integrated in wp fully.