Show only content in page after action click in WordPress admin

to create a page with your own content, you can do like that : add_action(“admin_menu”, function () { $post_type = get_post_type_object(“property”); add_submenu_page( ” ” , “Page title” , “” , $post_type->cap->edit_posts , “property__validationForm” , function () { do_action(“property/validationForm”); } ); }); add_action(“property/validationForm”, function () { ?> <pre><?php var_dump($_GET);?></pre> form <?php }); to create a URL … Read more

how to send two forms with one click (script ninjaforms id)

I partially stole this answer from SO $(“#idForm”).submit(function(e) { var url = “path/to/your/script.php”; // the script where you handle the form input. $.ajax({ type: “POST”, url: url, data: { form1: $(“#idForm”).serialize(), form2: $(“#idForm2”).serialize() }, // serializes the form’s elements. success: function(data) { alert(data); // show response from the php script. } }); e.preventDefault(); // avoid … Read more

How to add a new button on post

in the free theme Customizr, you can add content after the edit link with this code in the file functions.php of the child theme add_action(“__after_regular_heading_title”, function () { $post = $GLOBALS[“post”]; ?> <span> an addition after the link to edit “<?php echo htmlspecialchars($post->post_title);?>” </span> <?php });

creating different style CTA button in the menu

why don’t you add a class that is the permalink for example? ie $output .= “<li class=”nav-item $active_class $dropdown_class ” . implode(” “, $item->classes) . “”>”; (this line is strange first because it’s going to output “nav item $active_class $dropdown_class”…is that what you want?) but all the same it COULD be $output .= “<li class=”nav-item … Read more

button to toggle css styling / div visibility?

The getElementsByClassName, as the name suggests returns a collection of Elements, meaning an array, so x.style.display won’t work. x[0].style.display would work for the first element that it finds. But since this is WordPress, which by default loads Jquery, you could use: jQuery(‘.cart-multi-step-button-1’).click(function(){ jQuery(‘.cart_totals’).css({ ‘background’: ‘red’, ‘display’: ‘none’, }); }); You could also toggle a class … Read more

Add Cancel Button to a Custom Meta Box

I ended up using this: <a class=”clear_button hide-if-no-js button-cancel” title=”clear” data-clear style=”text-decoration:underline;”>Clear</a> It does the job. I was hoping for something more “WordPressy” but don’t see a metabox cancel function.