Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / ninja-forms-submissions.php
Last active January 14, 2022 13:37
Display Ninja Forms Submissions - Demonstrate viewing form submission data outside of the admin area. https://www.damiencarbery.com/2019/06/display-ninja-forms-submissions/
<?php
header('HTTP/1.1 200 OK');
define('WP_USE_THEMES', false);
/** Loads the WordPress Environment */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
$id = 3;
@yratof
yratof / cpt.php
Last active August 12, 2023 18:02
Wordpress AJAX search through custom post type
<form role="search" method="post" class="search-form padding-4" action="<?php echo home_url( '/' ); ?>">
<label>
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search...', 'placeholder' ) ?>" value="<?php echo get_search_query() ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
<input class="post_type" type="hidden" name="post_type" value="frequent" />
</label>
<input type="submit" class="search-submit button brand" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button' ) ?>" />
</form>
<script type="text/javascript">