Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter roirraw

    (@roirraw)

    I’m using WooCommerce version 3.6.5 with WooCommerce Subscriptions version 2.5.7. I’ve noticed that when you add subscription manually you can edit many important for my case option under “Schedule” like payment every/day, start date. I also have troubles understanding what is the difference in making a subscription product and setting under subscription product for instance payment every 2 months, and in making a subscription with payment every 2 months and adding there normal product.

    Thread Starter roirraw

    (@roirraw)

    Ahh, sorry for that. I just thought that there is a list of params which $_GET[”] is taking and what it gives back in wordpress, didn’t expect that it’s a minor case.

    So technically I should be able to change current “edit-comments.php” screen by adding a “pre_get_comments” hook. Is it possible to generate separate comments page without copy-paste of “edit-comments.php”? Like calling back some specific function in “add_submenu_page” hook along with “pre_get_comments” hook?

    Or You suggest that it makes no sense, and it should be achieved just by interrupting query of generic comments admin page with “pre_get_comments”? If so how should I achieve that along with keeping the ability to access all other comments?

    Thanks for all your help again.

    Thread Starter roirraw

    (@roirraw)

    I cannot find ‘views_edit-comments’ filter in documentation, so it’s hard for me to use it properly. Could u elaborate more on the second way using “pre_get_comments” action?

    $_GET[‘c’] and $_GET[‘dt’] can be found in “comments.php” file, for example this code:

    if ( isset( $_GET['dt'] ) ) {
    	if ( 'spam' == $_GET['dt'] ) {
    		$action = 'spam';
    	} elseif ( 'trash' == $_GET['dt'] ) {
    		$action = 'trash';
    	}
    }

    I thought its native for wordpress, am I wrong?

    Thread Starter roirraw

    (@roirraw)

    Thank you for your respond bcworkz. Your reply is helpful, but I want to create a more advanced solution. I have some experience in PHP as well as WP development. I’m familiar with Settings API, as well as basic usage of add_menu_page() function. Meanwhile I figured out alike solution to Your’s, I mean adding subpage which will redirect to hardcoded “edit-comments.php?post_type=example”, but both share same problem, whenever I click other links, for example “Approved”, I’m getting redirected to all approved comments, not my custom post type approved comments. I also found WP_Comments_List_Table class and after getting familiar with wp database structure, I’m thinking about creating wpdb query to fetch all my custom post type posts “where comment_count > 0”, and quering from database all comments by just fetched posts IDs. Then I could use fetched comments to initiate new WP_Comments_List_Table which is going to be used to create custom comments subpage. I want such subpage to be working same way as generic comments admin screen, but limited to my custom post type comments only. Am I thinking right way? Is it possible to achieve such thing?

    Also I understand how $_GET is working, I do not know where does ‘c’, ‘dt’ and other parameters come from and what do they carry along.

    • This reply was modified 5 years, 5 months ago by roirraw.
    • This reply was modified 5 years, 5 months ago by roirraw.
Viewing 4 replies - 1 through 4 (of 4 total)