WordPress Plugin Development - Part 17b - Admin Custom Fields

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 39

  • @psychoakustic
    @psychoakustic 6 месяцев назад

    Bro, I love you!!!❤‍🔥 People like you will save the planet, no doubts about!

  • @skepticalCoder
    @skepticalCoder 5 лет назад

    I gotta say. Wordpress is insanely complicated. But...nice to slowly see more things happening on the screen with each section of your tutorials. Thanks!

  • @sidneysousa3520
    @sidneysousa3520 7 лет назад +4

    Happy coding Alessandro!

    • @alecaddd
      @alecaddd  7 лет назад

      Happy Coding to you

  • @MyCasper1234567890
    @MyCasper1234567890 6 лет назад +2

    Very nice tutorial, wordpress works very confusing, but you explain very well.

    • @alecaddd
      @alecaddd  6 лет назад

      Thanks for watching :D

  • @keshavp6724
    @keshavp6724 4 года назад +2

    Thanks a lot for this awesome tutorial,
    really changed my outlook towards WP..
    and it helped me write much more manageable and readable code,
    I had a question for you if you could explain..
    so another thing that i implemented in this plugin was a logger..
    as i had to move ahead in a different direction due to the needs and specifications of my plugin,
    what struck me was that the object for a service was initialized twice and the issue with that is,
    i am using an API to integrate a Contact7Form with a different CRM,
    and in the log-file i saw that the session token retrieved after authentication with that API was generated twice,
    can you explain me why this would happen, and what would be a correct way to handle such integration..?

  • @Vitargo96
    @Vitargo96 6 лет назад +1

    Hi!, is this the same way to add custom fields in, for example, post entry page?
    Nice tutorials! Im learned so much

  • @sokostas1
    @sokostas1 5 лет назад +2

    Fantastic job!

  • @bdkoder
    @bdkoder 4 года назад

    Thank you for awesome videos.

  • @pierreleonsimard
    @pierreleonsimard 5 лет назад +12

    aaaaaaaah I don't know what I'm doiiiiiiiiiing D:

  • @kimcodemonkey
    @kimcodemonkey 6 лет назад +1

    This is a super awesome tutorial, alex. As you said, the WordPress settings api is extremely easily getting confused. However, there are the setting api framework such Redux which helps with build setting option easier. Could please make some kind of tutorial like building theme option with redux framework?

    • @alecaddd
      @alecaddd  6 лет назад

      Hi, thanks for watching. I never used the redux framework, so, unfortunately, I can't do any tutorials about it.
      Cheers

  • @rapinder7461
    @rapinder7461 7 лет назад +2

    Thany you

  • @bryanfahrenheit4596
    @bryanfahrenheit4596 6 лет назад

    10:42 Instead of concatenating the $value var in the echo statement I just used double quotations like this:
    echo "";

    • @alecaddd
      @alecaddd  6 лет назад +2

      You shouldn't really use single quotes for HTML markup as it can't be validated and it's not considered approved standard. No big deal anyway :D

    • @bryanfahrenheit4596
      @bryanfahrenheit4596 6 лет назад +1

      @@alecaddd You see? These are the things that I miss when I teach myself stuff, I didn't know that

  • @johnathanvargas5594
    @johnathanvargas5594 2 года назад

    Illegal offset type in C:\MAMP\htdocs\wp592\wp-admin\includes\template.php on line 1660 i keep getting this error and unable to find a solution to fix it

  • @klaasdeeindbaas
    @klaasdeeindbaas 4 года назад +1

    I like your tutorials, but it's getting a bit complicated here ... do you perhaps have the full code files downloadable somewhere? Especially now that you give functions in different classes the same name: eg you created a setSettings function in part 17A and now in part B you create another function also named setSettings, but in a different class. It'd be easier if I could scroll through the files to keep track of which exact functions go to which classes ...

    • @sdashdex6309
      @sdashdex6309 4 года назад +1

      In the description you habe his GitHub link where you can download the code

  • @stefanobartoli8685
    @stefanobartoli8685 4 года назад

    Hi Alessandro, I'm trying to follow your tutorial and since this point everything worked great. I'm dealing now with an Error: Call to undefined function Inc\Api\add_settings_section() ... do you have suggestions on how to solve it? It's kinda frustrating bc I've been stuck here for days. I tried to include also the /wp-admin/template.php where the method is defined, but the error changes from 'undefined function' to 'function name must be a string' Thanks for helping !

    • @alecaddd
      @alecaddd  4 года назад

      Check my source code on GitHub to see if you missed something.

  • @nobir98
    @nobir98 7 лет назад +1

    Feelings awesome

    • @alecaddd
      @alecaddd  7 лет назад +1

      A waterfall of emojis :D

    • @nobir98
      @nobir98 7 лет назад

      nope it's a LOVE emojis

  • @jacobsimpson575
    @jacobsimpson575 5 лет назад

    Notice: Undefined index: in \includes\API\SettingsApi.php on line 101
    Any idea how to fix this? I don't seem to see a difference in our code.

    • @jacobsimpson575
      @jacobsimpson575 5 лет назад

      solved it. Admin.php, when i copied the function of setSettings for the sections and fields, i left $this->settings->setSettings( $args ); the same for all of them.....(face smack) Thanks Alecaddd for these videos. I have learned so much.

  • @juliecleaves4478
    @juliecleaves4478 5 лет назад

    I'm almost through 17c and the only thing that displays for me is the button. Any ideas?

    • @juliecleaves4478
      @juliecleaves4478 5 лет назад

      In case anybody has this problem and their input fields are hidden, I found my error. In my case it was that I was calling the $register for the SettingsApi class before I did $this->setSettings();
      $this->setSections(); and $this->setFields();. Good luck!

  • @RudyGayRaptors
    @RudyGayRaptors 6 лет назад +2

    I have some plugins installed, and I have looked at the coding. Some developers only use part of the Settings API (again it's really confusing), they call the register_setting function but instead of using add_settings_section and add_settings_field what they do is they add all those html form code in add_menu_page callback

    • @alecaddd
      @alecaddd  6 лет назад +2

      Yes, that's another way of doing it, which I disagree with. Manually writing the structure and not relying on the built-in methods will open up the code to more issues. Using those methods from WordPress will print all the validations hidden fields and proper form attributes to handle a safe post request.
      Some developers like to manually write the form in the template because they want more control, but I personally think everything should be done respecting the proper WordPress workflow. Cheers

  • @RudyGayRaptors
    @RudyGayRaptors 6 лет назад +1

    Just like Aleccad said this is very confusing :( IMO building the settings page should have the same logic as adding custom fields in admin post type (add meta box, you add the html input, textarea, checkbox etc, then finally you manually call the update function).