Christian Chung
Forum Replies Created
-
Checking in on this. Have you had a chance to review the pull request? Anything else I can do?
WP Version: 4.7.2
BD Version: 4.1.7
BD Google Maps: 4.0.6
BD Zip Search: 4.0.6Difficult to provide steps to reproduce as I inherited the site pre-configured, I didn’t do the migration and didn’t set up the fields correctly. From what I can tell just by looking at things:
1. Set a TextArea field representing Content
2. Set a TextArea field representing Excerpt
3. Set Excerpt TextArea to auto-generate from ContentIrregardless, from the way that I’m reading your source code, I don’t see a way this wouldn’t cause an infinite loop. Considering the following object dump (this is the actual offending object instance):
object(WPBDP_FormField)[4529] private 'id' (WPBDP_Form_Field) => int 3 private 'type' (WPBDP_Form_Field) => object(WPBDP_FieldTypes_TextArea)[2630] private 'name' (WPBDP_Form_Field_Type) => string 'Textarea' (length=8) private 'association' (WPBDP_Form_Field) => string 'excerpt' (length=7) private 'shortname' (WPBDP_Form_Field) => string 'description' (length=11) private 'label' (WPBDP_Form_Field) => string 'Description' (length=11) private 'description' (WPBDP_Form_Field) => string '' (length=0) private 'tag' (WPBDP_Form_Field) => string 'excerpt' (length=7) private 'weight' (WPBDP_Form_Field) => int 4 private 'validators' (WPBDP_Form_Field) => array (size=0) empty private 'display_flags' (WPBDP_Form_Field) => array (size=2) 0 => string 'excerpt' (length=7) 1 => string 'search' (length=6) private 'field_data' (WPBDP_Form_Field) => array (size=7) 'allow_html' => boolean false 'allow_iframes' => boolean false 'allow_filters' => boolean false 'allow_shortcodes' => boolean false 'wysiwyg_editor' => boolean false 'wysiwyg_images' => boolean false 'auto_excerpt' => boolean true public 'css_classes' => array (size=0) empty public 'html_attributes' => array (size=0) empty
This would execute the following given the above steps as far as I can tell:
(WPBDP_FormField
is an empty wrapper forWPBDP_Form_Field
)1.
WPBDP_Form_Field::value( int $post_id, bool $raw )
2.WPBDP_FieldTypes_TextArea::get_field_value( WPBDP_Form_Field $field, int $post_id )
where$field
is theWPBDP_Form_Field
instance from step 1
3.WPBDP_FieldTypes_TextArea::get_field_html_value ( WPBDP_Form_Field $field, int $post_id )
4.WPBDP_Form_Field::value( int $post_id )
(same as #1, with no instance changes)Hope this helps. I’ll reach out via the contact form for the patch and apply.
Thanks,
Christian- This reply was modified 8 years, 1 month ago by Christian Chung.
Btw, bypassing the call to
WPBDP_FieldTypes_TextArea::get_field_html_value()
fixes it:public function get_field_value( &$field, $post_id ) { $value = parent::get_field_value( $field, $post_id ); // Only return auto-generated excerpt if there's no value at all. if ( 'excerpt' == $field->get_association() && $field->data( 'auto_excerpt') && ! $value ) $value = 'This fixes it.'; //$value = $this->get_field_html_value( $field, $post_id ); return $value; }
Hope that helps!
Forum: Fixing WordPress
In reply to: PHP File Redirection 404 ErrorThe theme root is where you theme functions.php, index.php, and style.css are. The template is where you place the
<form>
code.Forum: Fixing WordPress
In reply to: PHP File Redirection 404 ErrorPut it the theme root and try this:
<form action="<?php get_stylesheet_directory_uri() . '/mk.php'; ?>" method="GET">
An even better way would be the following:
In template:<form action="" method="get"> <input type="hidden" name="jiungusa_form_nonce" value="<?php echo wp_create_nonce('jiungusa_form_nonce');?>"> <!-- Rest of Form --> </form>
In functions.php
add_action( 'init', function() { if( ! empty( $_REQUEST['jiungusa_form_nonce'] ) ) { require_once( 'mk.php' ); } });
Forum: Fixing WordPress
In reply to: How do I get data from a nested array returned by $wpdb?You can control how the output of
$wpdb
methods is formatted. Options are:OBJECT – result will be output as a numerically indexed array of row objects.
OBJECT_K – result will be output as an associative array of row objects, using first column’s values as keys (duplicates will be discarded).
ARRAY_A – result will be output as a numerically indexed array of associative arrays, using column names as keys.
ARRAY_N – result will be output as a numerically indexed array of numerically indexed arrays.More at https://codex.www.ads-software.com/Class_Reference/wpdb
The function you’re looking for is wp_dequeue_script. What I believe is happening is that you are deregistering a script after it is queue’d up. That would theoretically cause an undefined index notice. However, you should note that plugins you’re using may enqueue scripts that (depending on priority) you may then break if you dequeue them afterward.
Forum: Fixing WordPress
In reply to: PHP error: Warning: call_user_func_array() expects parameter 1If done properly, you can still update the parent theme. That’s the point of child themes. Just backup first.
If you’re trying to debug it yourself, the error message means that the methods
tc_tagline_display
,tc_social_in_header
, do not exist in the classTC_header_main
. You can always find the class, and make sure the method exists.Forum: Fixing WordPress
In reply to: WP_Query Search Parameter for ANY wordsI’m not going to tell you what to do, but in my experience, it’s better to try to use an existing solution to problems such as these. Consider the following search term: “pancakes and syrup”.
explode( ' ', $_GET['s'];
would give you an array(“pancakes”, “and”, “syrup”) and searching for “and” would return basically everything.
Search plugins typically include filters for partial match, etc. It’s probably better use of your time to configure a search plugin to work rather than code your own solution. This isn’t the case for all issues, but in the particular case, it probably is.
Hope that helps.
Forum: Fixing WordPress
In reply to: PHP error: Warning: call_user_func_array() expects parameter 1Try updating the theme. If it’s up to date, you can also post the issue on the theme page:
https://www.ads-software.com/themes/customizrForum: Fixing WordPress
In reply to: create double role for administorPermissions in WordPress should (in most cases) be inherited. This is the default functionality for how core handles permission. Certain actions are given a capability ex. edit_posts which allows a user to edit posts. In the default setting, editors can edit posts. This capability is inherited by administrators. In practice, administrators can do everything editors can do, plus other things.
If you’re using a plugin to achieve the functionality in question, contact the plugin author. If you’ve created this yourself, ensure that any custom capabilities are inherited.
If it doesn’t feel like I’ve answered your question, no you cannot have two roles for one user. But at the same time, there should never be anything a user can do that an administrator cannot do.
Forum: Fixing WordPress
In reply to: PHP error: Warning: call_user_func_array() expects parameter 1That’s an issue with your theme. What theme are you using?
Forum: Fixing WordPress
In reply to: WP_Query Search Parameter for ANY wordsForum: Developing with WordPress
In reply to: Complete disable of Page/Post content areaalso, init is too early, the query hasn’t been parsed yet, so you can’t target a taxonomy.
Forum: Developing with WordPress
In reply to: Complete disable of Page/Post content areaI just tested mine, it works as expected. Try it, and let me know if it works for you too.