Forum Replies Created

Viewing 15 replies - 16 through 30 (of 40 total)
  • Thread Starter JP3

    (@jp3)

    Thanks for the quick and detailed responses!

    To be honest, I have an entire old VBulletin site I’m migrating over to WP, and I have so many other more important things to tackle, that I don’t have the time right now to mess with avatars.

    I WANT to use Avatar Privacy, but for now, I switched over to Simple User Avatar. It stores the avatar as the media file id in usermeta [‘mm_sua_attachment_id’].

    The idea is that I can move along on my site conversion and tackle the bigger fish, and when it’s quickly/easily a possibility, switch back to Avatar Privacy and move all current [‘mm_sua_attachment_id’] media ids over.

    Thanks again for the response and potentially adding this “add/update programmatically” feature in the future.

    Ignore my second reply…..I’ve actually tried code and it’s a no-go. I can’t figure out how to get the current submitted form ID outside of the perscribed hooks. Looks like the first option is your best bet.

    Just had another thought, and probably a better way to do what you’re trying to.

    Only add your filter when you need it to execute. The default will execute the default way and only execute your action/function when it’s actually needed:

    function save_posted_data( $posted_data ) {
    	
    	$args = array(
    		'post_type' => 'np-food',
    		'post_status'=>'draft',
    		'post_title'=>$posted_data['food-name'],
    		'post_content'=>$posted_data['food-desc'],
    	);
    	$post_id = wp_insert_post($args);
    
    	if(!is_wp_error($post_id)){
    		if( isset($posted_data['food-name']) ){
    			update_post_meta($post_id, 'food-name', $posted_data['food-name']);
    		}
    		// and so on
    		return $posted_data;
    	}
    }
    
    $form_id = $contact_form->id();
    if( $form_id == 1903 ) {
    	add_filter( 'wpcf7_posted_data', 'save_posted_data' );
    }

    In the example above, I put the return line back in the save_posted_data function, but you may still want to move it outside of the “if no error” statement block. Depends on the behavior you’re looking for if there is/isn’t an error.

    Just looking quickly, the only time you’re returning the post_data array is AFTER SUBMISSION IF NO ERROR.

    Without actually testing this, it could be as simple as moving the “return” line to do so every time your function is called, regardless:

    function save_posted_data( $posted_data ) {
    	
    	$form_id = $contact_form->id();
    	if( $form_id == 1903 ) {
    
    		$args = array(
    			'post_type' => 'np-food',
    			'post_status'=>'draft',
    			'post_title'=>$posted_data['food-name'],
    			'post_content'=>$posted_data['food-desc'],
    		);
    		$post_id = wp_insert_post($args);
    
    		if(!is_wp_error($post_id)){
    			if( isset($posted_data['food-name']) ){
    				update_post_meta($post_id, 'food-name', $posted_data['food-name']);
    			}
    			// and so on
    		}
    	}
    	return $posted_data;
    }
    add_filter( 'wpcf7_posted_data', 'save_posted_data' );
    Thread Starter JP3

    (@jp3)

    Thank you for taking the time to explain that. I’ll notify the authors of some of the more popular/common themes, but I think it’s a much bigger problem for the WP developers to tackle. Almost every theme I tried kicked out this error.

    Thread Starter JP3

    (@jp3)

    Posted a support thread here, but submitting a ticket as requested and linking to the WP thread here. I don’t personally NEED any of the features of the PRO version, but I would test them thoroughly and give feedback if I had them. Thank you for your quick reply!

    I have a similar question, but it’s using personally created custom post types. I have about 20 different post types. Some SHOULD be listed in the activity stream, some should NOT. What is the best way to go about integrating these? I looked at the code and didn’t see a hook I can tap into to feed my CPTs to the activity stream, but maybe there is one or one could be added in a future release?

    Also, semi-related, can custom post types be added to the profile tabs on a user/group profile page just like “Posts” is shown with all posts from that user/group?

    So, combining the two together, if I made a post_type called Event, is there a way to add an “Event” tab on profile pages, and add Events to the activity stream?

    To make it even more complicated for you, if I made a post_type called Event Booking that SHOULD have a (private) tab for a user profile page so they can view their personal/private event booking history, but should NOT be publicly viewable and should NOT be added to the activity stream.

    I gave a few examples of uses to show the desired flexibility, but the idea is to have a simple way to selectively choose which CPTs to add to the activity stream, and the profile page tabs, independent of eachother. A meta-field mapper of sorts that can be applied to ANY custom post type, instead of having to account for and code for specific plugin CPTs.

    Thread Starter JP3

    (@jp3)

    I don’t want you to think I’ve forgotten about you.

    I’m actively working on a v2.0 and have some really awesome things to show for it. A few more weeks and it should be ready.

    In the meantime, I did find a few more really minor bugs/compatibility fixes that probably don’t affect very many people. My 2.0 revisions took care of them, but I’m working on adapting the code for a v1.3 patch until 2.0 is ready. This sounds simple, but it’s more involved than you might think and you’ll understand when you see my code. It’s probably going to be a few more days until my 1.3 patch is done.

    In the meantime, send me an email when you have some time. I’ll send the revisions your way as soon as they’re done and then we can talk more about the co-author thing too.

    c o d e j p 3 [ A T ] g m a i l . c o m

    Thread Starter JP3

    (@jp3)

    OK, it looks like I’m having a little too much fun with my modifications.

    What I’ll have for you is:

    • absolutely complete multinetwork compatibility
    • seemless integration of multinetwork stuff into existing design/layout
    • advanced chart data and statistics
    • advanced networks/sites/plugins/themes detail pages
    • a few more small minor bug fixes, typos, and compatibility tweaks
    • verbiage logic for proper singular/plural of words like plugin(s) theme(s) site(s) blog(s) network(s)
    • subtle verbiage changes to clearly define “Network” “Site” “Multinetwork” “Multisite” and “Blog” since they’re so freaking confusingly mixed together all the time (blame WP for bad naming conventions)
    • distinct tracking, counts, and data for Single-Blog, Network-Sitewide, and Must-Use activation types
    • maybe more?

    It’s going to take me a little longer than a day or two to finish all of this, but I’ll get it to you sometime soon and you’re free to use (or not use) any parts of it as you see fit.

    Thread Starter JP3

    (@jp3)

    Alright, I’ve had a chance to play with it some. Instead of trying to explain what’s happening, I’m just going to alter the code slightly to take care of it and then I’ll send it to you for use in v1.3. It may or may not also include a few tweaks beneficial to multi-network users such as myself. Gimme a day or two to get it sorted out.

    Thread Starter JP3

    (@jp3)

    Just downloaded and gave a quick run-through.

    All notices and warnings seem to be 100% resolved.

    There’s only one or two minor quirks with plugin counts related to active_sitewide_plugins. I have to get back to work, but I’ll post details about the plugin count when I have time to thoroughly test it. For now I wanted to give you a heads up that I did not see ANY Deprecated or Warning notices and to give you some praise for amazingly quick response and actually caring. Thank you! I don’t spend a lot of time debugging most plugins and prefer to write my own when possible, but this one is SPECIAL so I’d hate to see it fall by the wayside like so many others.

    Thread Starter JP3

    (@jp3)

    wpdb::prepare issues are gone, but all other notices/warnings still exist.

    I ran through the plugin and logged all pages and actions. There’s a bit much for addition here as a post, so here’s a link to a text file with all the details.

    https://www.dropbox.com/s/rw94l6hgtqvkgwg/multisite-auditor-logs.txt?dl=0

    Thread Starter JP3

    (@jp3)

    I swear I’m not trying to be pushy or anything.

    I know I have an odd setup, but it may help pro-actively resolve issues others may run into.

    For my setup, superadmin is the only user who can activate plugins. They are Network Activated for all child Blogs on a per-Network basis. Blogs (blog_id) don’t individually use plugins. They only inherit what the parent site_id has Network Activated. Plugins are only activated/deactivated per Network, not per Blog.

    My db tables end up with an empty active_plugins array or no active_plugins entry at all for each blog.
    active_sitewide_plugins gets all of my active plugin info.

    Perhaps factoring active_sitewide_plugins into the audit would be the simplest, most logical, and most thorough approach.

    I just want to give you as much info to go on as I can instead of leaving you in the dark trying to guess what’s happening and why.

    Thanks again for an amazing plugin!!!

    Thread Starter JP3

    (@jp3)

    I wanted to give you a heads up on the division by zero errors.

    I’m running a multi-network of multi-sites to test things out. When a site has no plugins active (value of “active_plugins” in the wp_options table is “a:0:{}” for that given network of sites), zero results are returned. With zero results being returned, the “wp_MSA_plugins” table doesn’t get anything added to it. There’s currently no real checks for this right now, so when your plugin does counts based upon the results of either the active_plugins array for the current site or the MSA_plugins db table, the division by zero error occurs as well as the string of subordinate “undefined” errors.

    Hope that helps!

    First of all, thank you for your tips and lessons learned. Some were new to me, some I also learned the hard way.

    The activity I am working through now is the scenario where we have domains that are “development” within the network install, that we want to promote to “production” with change of domain, etc. Effectively a deployment management approach.

    Am I wrong for thinking that this “promotion” task should be as simple as changing the parent_site_id from the development network site_id to the production network site_id in the WP_Blogs DB table, and then doing a find/replace within other tables to update the old parent_ID to the new parent_ID?????

Viewing 15 replies - 16 through 30 (of 40 total)