Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter mcbmcb0

    (@mcbmcb0)

    possible, tho undesirable duplication on the page. maybe under some circumstances removing the stripe tag before the form is created? (obviulsy that’s less selectable from another control, but the page could reload with js).

    is there a hook or filter when the form is initially loaded by cf7? (searching, i am searching…)

    Thread Starter mcbmcb0

    (@mcbmcb0)

    i guess when pulling on a piece of wp spaghetti, its hard to know which end it is connected to ??

    i’ll look into that. or move to recaptcha. thanks

    Thread Starter mcbmcb0

    (@mcbmcb0)

    yes – hCaptcha for WP

    i guess that’s the problem. time to move to recaptcha? tho a soultion with hcaptcha would be great

    Thread Starter mcbmcb0

    (@mcbmcb0)

    https://apacdbt.org/register/

    using hcaptcha, i guess there is no integration like recaptcha, so maybe that’s the issue for me.

    Thread Starter mcbmcb0

    (@mcbmcb0)

    even better – given we’re in the DOM, i add an item to the nav menu when the conditons are met (rather than removing one when they are now – more fail-safe:

    ?$frag = $dom->createDocumentFragment();

    $frag->appendXML( '<li class=" wp-block-navigation-item wp-block-navigation-link">

    ? ? ?<a class="wp-block-navigation-item__content" href="/Admin-info/">

    ? ? ?<span class="wp-block-navigation-item__label">Admin</span></a></li>');

    $menu_item->parentNode->AppendChild( $frag ); // at then end

    Thread Starter mcbmcb0

    (@mcbmcb0)

    Hi

    thanks for your suggestons. the goal is to hide a menu item for non-admins. As far as i can tell, i’ve duplicated and modified the standard nav menu under ‘patterns’.

    unfortunately, the filters for wp_nav_menu_items and render_block_core/navigation-link don’t fire for me, but ‘render_block_core/navigation‘ does! i can catch the item with the code suggested by Brad (thanks!).

    $menu_item->parentNode->removeChild($menu_item) would error, so I can hide it by

    $menu_item->setAttribute('href', '');
    $menu_item->textContent='';

    which does leave some padding for the empty <a> , but its tolerable.

    On a side note, i’m slightly shocked I have to crawl the DOM to find it, but it runs fast enough regardless.

    thanks again!

    Thread Starter mcbmcb0

    (@mcbmcb0)

    ok, that wasn’t hard: in child theme’s functions.php:

    add_filter(‘wpcf7_send_everything_submit_button_add’, ‘__return_false’);

    thanks for the plugin – its great

    Thread Starter mcbmcb0

    (@mcbmcb0)

    ok one minute after asking this, i have the answer.
    the stupid visual editor was adding `<code>’ tags inside the shortcode brackets so this was in the db:
    [<code>pagelist</code><code>child_of="2"</code>]

    editing as raw text solved the problem. I guess this happens on all shortcodes.
    also worth noting i can’t display the actual code tags added accurately as this editor also keeps modifying what i type. gotta love wp for its time-saving eficiencies!

    now works fine.

    • This reply was modified 3 years, 5 months ago by mcbmcb0.
    • This reply was modified 3 years, 5 months ago by mcbmcb0.
    • This reply was modified 3 years, 5 months ago by mcbmcb0.
    Thread Starter mcbmcb0

    (@mcbmcb0)

    hi Dev – and others reviewing this.
    i read up on mediasync but haven’t tried it. it says it will import photos from other locations to your media library in the db.that’s not what i had in mind as my images (many hundreds) are in a subfolder and used by another plugin and i don’t want them in the media library. but it would likly be useful for many others and allow wp-paint to edit them.

    cheers

    Thread Starter mcbmcb0

    (@mcbmcb0)

    Dev – thanks for your reply.
    just a suggestion – it would be great if a future version could also edit images within the media upload subfolder – ie those not attached to posts. i see the js can manage this and just need different php handling.
    cheers

    Thread Starter mcbmcb0

    (@mcbmcb0)

    i used the freemius fixer plugin (google it, download then install the zip) and its now cleaned up.
    the lack of support on this and the reliance on unreliable dependencies (like freemius) is a concern for this otherwise good plugin.

    Thread Starter mcbmcb0

    (@mcbmcb0)

    thanks Connor – lots of ways to get this done.
    the return $data is a good reminder for the filter

    Thread Starter mcbmcb0

    (@mcbmcb0)

    no answers? so here what i did: i couldn’t get the above to work for me so added my own tag in the theme’s functions.php then put [form-info] in the form:

    add_action( 'wpcf7_init', 'custom_add_form_tag_id' );
    function custom_add_form_tag_id() {
        wpcf7_add_form_tag( 'form_info', 'custom_id_form_tag_handler' ); // "clock" is the type of the form-tag
    }
    function custom_id_form_tag_handler( $tag ) {
        
    	$wpcf7 = WPCF7_ContactForm::get_current();
    	$form_id = $wpcf7->id();
    	$form_title = $wpcf7->title();
    	$form_name = $wpcf7->name();
    	return "<input type='hidden' name='form_id' value='$form_id' />"
    		. "<input type='hidden' name='form_title' value='$form_title' />"
    		. "<input type='hidden' name='form_name' value='$form_name' />";
    }

    HTH

    no idea about enfold (a theme?) but with contactformdb the form name is the what contact form 7 would call the form title. in the dashboard, the ‘contact form DB’ data table selects your forms by their title so if all else fails pick it out of there.
    BTW i’ve found this a very good plugin. good luck!

    Thread Starter mcbmcb0

    (@mcbmcb0)

    Thanks Neil, this is promising. but so far I can’t get a result using ‘getting context values’ with post or post-meta.
    On form submit I can see ‘_wpcf7’ is posted, (ie, a key in $_POST) so have tried this:
    [hidden form-id-post default:post "_wpcf7"]
    but only the string ‘_wpcf7’ is returned..
    Also I can see ‘_wpcf7’ in the wp db post_meta table showing the form id so tried this:
    [hidden form-id2 default:post_meta "_wpcf7"]
    but again the string ‘_wpcf7’ is returned.

    can you see what i am doing wrong?
    is there a list of CF7 posts or post_meta data somewhere

    Thanks

Viewing 15 replies - 1 through 15 (of 21 total)