Version Description
- Tighten post type permissions so submissions and forms don't have archives and single views.
Download this release
Release Info
| Developer | tlovett1 |
| Plugin | |
| Version | 6.8.1 |
| Comparing to | |
| See all releases | |
Code changes from version 6.8 to 6.8.1
classes/class-ccf-choice-cpt.php
CHANGED
|
@@ -28,6 +28,7 @@ class CCF_Choice_CPT {
|
|
| 28 |
$args = array(
|
| 29 |
'label' => esc_html__( 'Form Field Choices', 'custom-contact-forms' ),
|
| 30 |
'public' => false,
|
|
|
|
| 31 |
'query_var' => false,
|
| 32 |
'rewrite' => false,
|
| 33 |
'capability_type' => 'post',
|
| 28 |
$args = array(
|
| 29 |
'label' => esc_html__( 'Form Field Choices', 'custom-contact-forms' ),
|
| 30 |
'public' => false,
|
| 31 |
+
'has_archive' => false,
|
| 32 |
'query_var' => false,
|
| 33 |
'rewrite' => false,
|
| 34 |
'capability_type' => 'post',
|
classes/class-ccf-custom-contact-forms.php
CHANGED
|
@@ -19,7 +19,29 @@ class CCF_Custom_Contact_Forms {
|
|
| 19 |
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
| 20 |
add_filter( 'plugin_action_links', array( $this, 'filter_plugin_action_links' ), 10, 2 );
|
| 21 |
add_action( 'admin_notices', array( $this, 'permalink_warning' ) );
|
|
|
|
| 22 |
add_action( 'admin_init', array( $this, 'flush_rewrites' ), 10000 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
|
| 25 |
/**
|
| 19 |
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
| 20 |
add_filter( 'plugin_action_links', array( $this, 'filter_plugin_action_links' ), 10, 2 );
|
| 21 |
add_action( 'admin_notices', array( $this, 'permalink_warning' ) );
|
| 22 |
+
add_action( 'registered_post_type', array( $this, 'make_post_types_public' ), 11, 2 );
|
| 23 |
add_action( 'admin_init', array( $this, 'flush_rewrites' ), 10000 );
|
| 24 |
+
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
/**
|
| 29 |
+
* Trick API into thinking non publically queryable post types are queryable
|
| 30 |
+
*
|
| 31 |
+
* @param string $post_type
|
| 32 |
+
* @param array $args
|
| 33 |
+
* @since 6.8.1
|
| 34 |
+
*/
|
| 35 |
+
public function make_post_types_public( $post_type, $args ) {
|
| 36 |
+
global $wp_post_types;
|
| 37 |
+
|
| 38 |
+
$type = &$wp_post_types[ $post_type ];
|
| 39 |
+
|
| 40 |
+
$json_post_types = array( 'ccf_form', 'ccf_submission' );
|
| 41 |
+
|
| 42 |
+
if ( in_array( $post_type, $json_post_types ) ) {
|
| 43 |
+
$type->show_in_json = true;
|
| 44 |
+
}
|
| 45 |
}
|
| 46 |
|
| 47 |
/**
|
classes/class-ccf-field-cpt.php
CHANGED
|
@@ -34,6 +34,7 @@ class CCF_Field_CPT {
|
|
| 34 |
'capability_type' => 'post',
|
| 35 |
'hierarchical' => false,
|
| 36 |
'supports' => false,
|
|
|
|
| 37 |
);
|
| 38 |
|
| 39 |
register_post_type( 'ccf_field', $args );
|
| 34 |
'capability_type' => 'post',
|
| 35 |
'hierarchical' => false,
|
| 36 |
'supports' => false,
|
| 37 |
+
'has_archive' => false,
|
| 38 |
);
|
| 39 |
|
| 40 |
register_post_type( 'ccf_field', $args );
|
classes/class-ccf-form-cpt.php
CHANGED
|
@@ -585,7 +585,8 @@ class CCF_Form_CPT {
|
|
| 585 |
$args = array(
|
| 586 |
'labels' => $labels,
|
| 587 |
'public' => true,
|
| 588 |
-
'publicly_queryable' =>
|
|
|
|
| 589 |
'show_ui' => true,
|
| 590 |
'show_in_menu' => true,
|
| 591 |
'query_var' => false,
|
|
@@ -593,6 +594,7 @@ class CCF_Form_CPT {
|
|
| 593 |
'capability_type' => 'post',
|
| 594 |
'hierarchical' => false,
|
| 595 |
'supports' => array( 'title' ),
|
|
|
|
| 596 |
);
|
| 597 |
|
| 598 |
register_post_type( 'ccf_form', $args );
|
| 585 |
$args = array(
|
| 586 |
'labels' => $labels,
|
| 587 |
'public' => true,
|
| 588 |
+
'publicly_queryable' => false,
|
| 589 |
+
'exclude_from_search' => true,
|
| 590 |
'show_ui' => true,
|
| 591 |
'show_in_menu' => true,
|
| 592 |
'query_var' => false,
|
| 594 |
'capability_type' => 'post',
|
| 595 |
'hierarchical' => false,
|
| 596 |
'supports' => array( 'title' ),
|
| 597 |
+
'has_archive' => false,
|
| 598 |
);
|
| 599 |
|
| 600 |
register_post_type( 'ccf_form', $args );
|
classes/class-ccf-submission-cpt.php
CHANGED
|
@@ -43,12 +43,13 @@ class CCF_Submission_CPT {
|
|
| 43 |
'exclude_from_search' => true,
|
| 44 |
'show_in_nav_menus' => false,
|
| 45 |
'show_ui' => false,
|
| 46 |
-
'publicly_queryable' =>
|
| 47 |
'query_var' => false,
|
| 48 |
'rewrite' => false,
|
| 49 |
'capability_type' => 'post',
|
| 50 |
'hierarchical' => false,
|
| 51 |
'supports' => false,
|
|
|
|
| 52 |
);
|
| 53 |
|
| 54 |
register_post_type( 'ccf_submission', $args );
|
| 43 |
'exclude_from_search' => true,
|
| 44 |
'show_in_nav_menus' => false,
|
| 45 |
'show_ui' => false,
|
| 46 |
+
'publicly_queryable' => false,
|
| 47 |
'query_var' => false,
|
| 48 |
'rewrite' => false,
|
| 49 |
'capability_type' => 'post',
|
| 50 |
'hierarchical' => false,
|
| 51 |
'supports' => false,
|
| 52 |
+
'has_archive' => false,
|
| 53 |
);
|
| 54 |
|
| 55 |
register_post_type( 'ccf_submission', $args );
|
custom-contact-forms.php
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
* Plugin URI: http://www.taylorlovett.com
|
| 5 |
* Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
| 6 |
* Author: Taylor Lovett
|
| 7 |
-
* Version: 6.8
|
| 8 |
* Author URI: http://www.taylorlovett.com
|
| 9 |
*/
|
| 10 |
|
| 4 |
* Plugin URI: http://www.taylorlovett.com
|
| 5 |
* Description: Build beautiful custom forms the WordPress way. View live previews of your forms while you build them.
|
| 6 |
* Author: Taylor Lovett
|
| 7 |
+
* Version: 6.8.1
|
| 8 |
* Author URI: http://www.taylorlovett.com
|
| 9 |
*/
|
| 10 |
|
readme.txt
CHANGED
|
@@ -35,6 +35,9 @@ For questions, feature requests, and support concerning the Custom Contact Forms
|
|
| 35 |
|
| 36 |
== Changelog ==
|
| 37 |
|
|
|
|
|
|
|
|
|
|
| 38 |
= 6.8 =
|
| 39 |
* Configurable "from" name field
|
| 40 |
* Minor variable stomping bug fix
|
| 35 |
|
| 36 |
== Changelog ==
|
| 37 |
|
| 38 |
+
= 6.8.1 =
|
| 39 |
+
* Tighten post type permissions so submissions and forms don't have archives and single views.
|
| 40 |
+
|
| 41 |
= 6.8 =
|
| 42 |
* Configurable "from" name field
|
| 43 |
* Minor variable stomping bug fix
|
