Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,626 through 2,640 (of 3,707 total)
  • Author
    Posts
  • in reply to: Click counter #7034
    Anh TranAnh Tran
    Keymaster

    I think you write the update_post_meta incorrectly, it should be:

    update_post_meta( get_the_ID(), 'link_counter', $count );

    in reply to: How to set meta_query of Group cloneable fields for search #7023
    Anh TranAnh Tran
    Keymaster

    Thanks a lot for your solution. It's extremely helpful for other people.

    in reply to: How to setup capability for editors? #7012
    Anh TranAnh Tran
    Keymaster

    Hi,

    Do you mean create a settings page for editors? If so, please set the 'capability' => 'edit_pages' for the settings page. The capability edit_pages is available for only editors and admins.

    If you need a plugin to manage/create custom capabilities, please try the Members.

    in reply to: Show meta box only for top parent page ID #7011
    Anh TranAnh Tran
    Keymaster

    Hi again,

    I found the problem for your situation. Your check doesn't run when post is updated, because there's no $GET['post']. In that case, you need to get post ID via $_POST. Here is the code:

    function prefix_parent_page_id_check() {
    	$parents = get_post_ancestors( prefix_get_post_id() );
    	return $parents && 901 == array_pop( $parents );
    }
    
    function prefix_get_post_id() {
    	if ( isset( $_GET['post'] ) ) {
    		return intval( $_GET['post'] );
    	}
    	if ( isset( $_POST['post_ID'] ) ) {
    		return intval( $_POST['post_ID'] );
    	}
    
    	return false;
    }
    in reply to: Show meta box only for top parent page ID #6990
    Anh TranAnh Tran
    Keymaster

    Why don't you use parent rule? It's supported by default ๐Ÿ˜‰

    in reply to: Sometimes user meta are not saved #6987
    Anh TranAnh Tran
    Keymaster

    Strange, I've just tested with your code and it works. Do you have any "check" code that runs along with (maybe before) the code for Meta Box?

    in reply to: Creating a custom table API #6986
    Anh TranAnh Tran
    Keymaster

    Hi,

    It's recommended to use a hook like 'plugins_loaded', 'init' or better - activation hook to create a new table. In case of a theme, you can hook into 'init', like this:

    add_action( 'init', 'prefix_create_table' );
    function prefix_create_table() {
        if ( ! class_exists( 'MB_Custom_Table_API' ) ) {
            return;
        }
        MB_Custom_Table_API::create( 'my_custom_table', array(
            'address' => 'TEXT NOT NULL',
            'phone'   => 'TEXT NOT NULL',
            'email'   => 'TEXT NOT NULL',
        ), array( 'email' ) );
    }

    For more info, please see the sub-section E. in the section Notes of the documentation.

    in reply to: 'std' doesn't work in settings page #6985
    Anh TranAnh Tran
    Keymaster

    Hi,

    The 'std' value works only the first time, e.g. when you haven't save any settings. In your case, if you delete the field value, then the plugin should "remember" your choice - whatever you did - which is the empty value in this case. It would be much confused if it shows the 'std' value, because two things: 1) you wonder where it comes from and 2) you can't actually save an empty value.

    in reply to: Show meta box only for top parent page ID #6984
    Anh TranAnh Tran
    Keymaster

    Can I see your function for test top parent page ID? Can you post your code?

    in reply to: Image_Select not saving #6950
    Anh TranAnh Tran
    Keymaster

    Hi,

    I've just tried your code with Conditional Logic plugin enabled. Everything works as expected.

    Maybe the problem is in the custom JavaScript code, which might breaks the JS code in the plugin(s). Can you please check when exactly the post doesn't save image_select value?

    in reply to: How to set meta_query of Group cloneable fields for search #6949
    Anh TranAnh Tran
    Keymaster

    Hi,

    When you use cloneable fields (whether it's a group or not), the data is saved as a serialized array in the database. That makes the default meta_query doesn't work when search for posts by meta value.

    In this case, you need to use a plugin like SearchWP.

    in reply to: Reset All Meta Values #6948
    Anh TranAnh Tran
    Keymaster

    Hi,

    You can run a SQL query like this:

    DELETE FROM wp_postmeta WHERE meta_key IN ('field1', 'field2');

    in reply to: I'd like a refund please #6823
    Anh TranAnh Tran
    Keymaster

    No problem, refund is sent.

    If you change your mind, we'll be happy to help.

    in reply to: โœ…Multiple file_upload fields #6772
    Anh TranAnh Tran
    Keymaster

    I'm afraid this is a hard problem. As the file_upload uses Media Library to upload files, all it does is calling the popup, passing the required parameters for the uploader (mime types, file size, etc.) and parsing the returned data. I've just checked the code and couldn't find anything related to the current field, because the uploader doesn't need that. But can you try print_r everything global ($_POST, $_GET, etc.) when filtering? Probably I'm missing something.

    Anh TranAnh Tran
    Keymaster

    Hi,

    I've just tested your code and here is the recorded screen:

    http://imgur.com/l7jFZoq

    I guess the problem is caused by cached JavaScript. In every new version of Group extension, most of the changes are in JavaScript file. So please try clearing browser cache (or Ctrl-F5) and check it again.

    Thanks,
    Anh

Viewing 15 posts - 2,626 through 2,640 (of 3,707 total)