Okay
  Public Ticket #3605195
Why use too much magic number in your code base
Closed

Comments

  • Talha started the conversation

    I am working on customize the search result page & others page also.

    getting so much magic number in code base with no explanation 

  • [deleted] replied

    Im sorry could not understand this magic number , can you please explain more on this?

  • Talha replied

    What do you mean by this 


    $course_search == 1 , $course_search == 2.


    course_search option value is 1 & 2 .

    I mean this is magic number


    2772050327.png
  • [deleted] replied

    they are value of wplms -> header -> Navigation Search

    0 means no search , 1 means course search , 2 means course search with category dropdown 

    array(
    'id' => 'course_search',
                            'title' => __('Navigation Search', 'vibe'),
                            'sub_desc' => __('Force the header search to search only in courses', 'vibe'),
                            'type' => 'button_set',
    'options' => array('0' => __('No','vibe'),'1'=>__('Course Search','vibe'),'2'=>__('Course Category Search after menu','vibe'),'3'=>__('Course Category Search before menu','vibe')),//Must provide key => value pairs for radio options
    'std' => '0'
    ), 


  • Talha replied

    Thanks for your reply .
    Just a feedback if you use string as a key or value that will be helpful others developer.

  • [deleted] replied

    yes we know but the issue is that we cannot change it since this is stored now in many of our users options .