Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi. I also see the potenial for this mainwp integration. Would be good exposure to your plugin and also help thousands of us. Thanks, Jamie

    Thread Starter Jamie Robe

    (@onmountain)

    Thanks Jory,
    Turns out everything was firing, but I wasn’t able to get the function to write into my own log file. My bad 😉 I think that was a permissions thing. What tricked me was that save_post was working (and logging into my log file) when I clicked update on a regular post or page, but not a CPT. I isolated it being only a PODS issue by coding a simple CPT in a test plugin and that also did not appear to work, so I figured out it must have been something of my doing…

    I simply set up the wp_debug log and a write_log function, and using that could see it was actually working for any CPT, including a pods CPT 🙂 My confidence in using PODS and debugging a complex app is high – thanks to you and your team for building a great system.

    In case this helps any future programmer, here is soem code to help debug:

    //////
    // This is a logging function for any debugging task 
    // NOTES:  Youy must have the following lines in the wp-config.php file in the root folder, which
    //      puts a debug.log text file under the wp-content folder under root
    //
    //
    // define( 'WP_DEBUG', true );
    // define( 'WP_DEBUG_DISPLAY', false );
    // define( 'WP_DEBUG_LOG', true );
    //
    // NOTES: install Error Log Viewer Plugin by bestwebsoft to view log from admin menu
    
    // for error logging
    if (!function_exists('write_log')) {
        function write_log ( $log ) {
            if ( true === WP_DEBUG ) {
                if ( is_array( $log ) || is_object( $log )) {
                    error_log( print_r( $log, true ));
                
                } else {
                    error_log( $log );
                }
            }
        }
    }
    
    //
    //////

    You can then use the log to test what is happening “behind the scenes”:

    add_action( 'save_post', 'psc_anyposttype_save', 10, 3 );
    
    function psc_anyposttype_save($post_id, $post, $update) {
    
    write_log('I am in the save_post hook for post_id = '.$post_id.' -- post post id = '.$post->ID.' -- type='.$post->post_type);
    
    } 

    Again, encountering bugs and problems can be very frustrating for coders, BUT it sure helps you understand the framework better, so it was a constructive (even if very frustrating) few days. Good luck everyone and as they say on Gallaxy Quest … never surrender 🙂

    Thread Starter Jamie Robe

    (@onmountain)

    Thank you so much!!! Such a detailed example will help a lot of people.

    Hi @jbonlinea,
    I want to do the same thing – use the values of custom fields added thru this plugin. Have you figured anything out? All I could get was access to the pmpro membership fields, but not the pods fields extending that.

    Peace,
    Jamie

    Hi. I can only tell you what has been working for me. Do not know if there is a “better” way or not:

    I am using code to create a shortcode [list_podxyz], and I put that code into an normal WP page. The code allows me to put a where statement before I loop thru the CPT podxyz, using a field I added called memberuserid. It is a number field and each record has the user id of the creator of each record.

    What I do to populate that field is also using code to create a PODS form, and I default the value to whatever user id is logged in and doing the insert/edit of that specific record. I also set the memberuserid field to hidden, since they do not have to see or know this info.

    It all seems to work well.

    The reason I hesitate to say this is the “best” way or not, is the relationships thing. I was thinking that it might offer another method of attaching (in code) a submitted form, by some sort of relationship to the user, etc.

    Good luck,
    Jamie

    Thread Starter Jamie Robe

    (@onmountain)

    LOL it is CTRL H. Works great!

    Thread Starter Jamie Robe

    (@onmountain)

    Thank you. That is helpful info 🙂

    Thread Starter Jamie Robe

    (@onmountain)

    Hi Bruce,
    I did a little research in ACE Editor and found that there is a configuration option that can be set.

    In the plugin I found the code at Includes/File_manager/lib/js/extras/editors.default.js

    around line 992 , I found enableLiveAutocompletion: false
    So I set that line to true. Now it does the programming auto complete when I open any file in the ace editor.

    ace.config.loadModule('ace/ext/language_tools', function () {
    								ace.require('ace/ext/language_tools');
    								editor.setOptions({
    									enableBasicAutocompletion: true,
    									enableSnippets: true,
    									enableLiveAutocompletion: true
    								});

    My problem is that when I open the Ace Editor options panel I can’t seem to close or save any changes to any option.
    The solution I have above will obviously revert back to the false when the plugin gets update. If you have any suggestions on how to keep this enableLiveAutocompletion: true please let me know 🙂

    I wish this were a user settable Filester plugin option. This is a fundamental tool for any programmer using any editor on PHP or CSS.

    I am not sure if codemirror has a similar autocomplete setting or not. But Ace seems pretty powerful.

    Jamie

Viewing 8 replies - 1 through 8 (of 8 total)