Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter diceit

    (@diceit)

    Thanks for the advice. Did take some time but finally was succesful.

    The plugin causing the fault was https://ww.wp.xz.cn/plugins/nggimagerotation/.

    I don’t know exactly if its used anymore, so I think we can go further without it.

    Thread Starter diceit

    (@diceit)

    In the meantime I got some progress.

    In a former project I needed to add some extra fields from custom post types to the admin mail. So I added in lib-aux.php ahter the “Excerpt”_replacement:

    $m 	= str_replace( '{Excerpt}',		$post_excerpt, $m );
    	
    	// DC: Hook zum Einfuegen eigener Variablen
    	$i = $page;
    	$m = apply_filters( 'cforms_apinst_email_filter', $m, $pid, $i );
    	

    and hooked the filter in my functions.php
    add_filter('cforms_apinst_email_filter','apinst_email_filter',10,3);

    to do somthing like

    function apinst_email_filter( $mailtext, $pid, $i ) {
        
    	// get custom fields
    	
    	$custom = get_post_custom($pid);
    	$myvalue=$custom["_myfield"];
    	$mailtext 	= str_replace( '{myplaceholder}',$myvalue, $mailtext );
    
        return $mailtext;
    	
    }

    In the actual project I have to do something similar when the form is rendered. I need to read the available values for a checkbox from a list of custom post types. After some research my approach is to put the hook in cform.php after line 355, so i can read and modify each field value.

    Any progress on this topic? It would also be a great help for me.

    Regards

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