reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.74k stars 584 forks source link

Taxonomy Term Meta Not Saving When Creating a New Category #4032

Closed mafiayemakhfi closed 1 month ago

mafiayemakhfi commented 1 month ago

Site Health Report

WordPress Version: 6.6.2 PHP Version: 7.4.6 ReduxFramework 4.4.18 Installed as Plugin

Steps to reproduce

1. Set up a Redux taxonomy using the following code:
2. Navigate to the "Add Category" page in the WordPress admin.
3. Fill in the fields defined in the Redux taxonomy options.
4. Save the new category.

Expected Behavior

The data entered in the fields should be saved and associated with the newly created category. Actual Behavior

Actual Behavior

The data is not saved when creating a new category. It only appears to be saved when I edit the category after creation.

Any Error Details (PHP/JavaScript)

No relevant PHP error messages or JavaScript console errors were found during testing. The issue seems to be related to the saving process during category creation.


$opt_name = 'my_redux_options';

Redux_Taxonomy::set_args( $opt_name, [
    'opt_name'  => $opt_name,
    'dev_mode'  => true,
] );

   Redux_Taxonomy::set_term( 
       $opt_name, 
       array(
           'id'             => 'demo-taxonomy',
           'title'          => esc_html__( 'Cool Options', 'core' ),
           'taxonomy_types' => array( 'category' ),
           'sidebar'        => false,
           'style'         => 'wp',
           'add_visibility' => true, 
           'sections'       => array(
               array(
                   'title'  => esc_html__( 'Home Settings', 'core' ),
                   'icon'   => 'el-icon-home',
                   'fields' => array(
                       array(
                           'id'    => 'image',
                           'type'  => 'media',
                           'title' => esc_html__( 'Image', 'umusic')
                       ),
                       array(
                           'id'             => 'born',
                           'type'           => 'text',
                           'add_visibility' => true,
                           'title'          => esc_html__( 'Born', 'core' ),
                       ),
                       array(
                           'id'             => 'genre',
                           'type'           => 'text',
                           'add_visibility' => true,
                           'title'          => esc_html__( 'Genre', 'core' ),
                       ),
                   )
               )
           )
       )
   );
kprovance commented 1 month ago

The site health report is incomplete.

kprovance commented 1 month ago

Using the sample code and instructions you provided, I was unable to duplicate your issue. The information I entered saved as designed. I verified it in the database and through recalling the code on the frontend. See the video below (the database verification didn't show as it was on the second monitor. Everything else did).

https://www.awesomescreenshot.com/video/32749724?key=04ddcff887e030434d59799c93918199

mafiayemakhfi commented 1 month ago

Using the sample code and instructions you provided, I was unable to duplicate your issue. The information I entered saved as designed. I verified it in the database and through recalling the code on the frontend. See the video below (the database verification didn't show as it was on the second monitor. Everything else did).

https://www.awesomescreenshot.com/video/32749724?key=04ddcff887e030434d59799c93918199

Thank you for your quick and helpful response to my GitHub issue! Your support means a lot to me. i have a question. Is it normal for the repeater field not to load in Redux_Taxonomy? Thank you!

kprovance commented 1 month ago

I don't know. For a taxonomy interface? It's not recommended. The idea is not to make the interface already more confusing that it is. I'm not certain Dovy ever intended the repeater to be used in the taxonomy interface or how that would work with how it stores data.

mafiayemakhfi commented 1 month ago

I don't know. For a taxonomy interface? It's not recommended. The idea is not to make the interface already more confusing that it is. I'm not certain Dovy ever intended the repeater to be used in the taxonomy interface or how that would work with how it stores data.

Anyway, thank you for your attention

kprovance commented 1 month ago

@mafiayemakhfi—There is an issue with repeater in the taxonomy extension. I'm pretty sure I can fix it, but it may not be finished this week. I created another issue in the issue tracker that deals with it, in case you want to follow.