Part 1: Actions - WordPress Hooks Tutorial For Beginners 2019

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

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

  • @WPCasts
    @WPCasts  5 лет назад +14

    Thanks for watching! Don't forget to subscribe and follow me on Twitter

  • @franciswafula3840
    @franciswafula3840 3 года назад +3

    Most tutorials are telling me how to use hooks but not telling me what they are and the difference between actions and hooks. This was the first sentence in this tutorial. Thank you for explaining this concept simply

  • @bensmith807
    @bensmith807 5 лет назад +31

    Never have I seen a coding tutorial explained so simply and to the point! This was very helpful!

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

      Thank you so much! I’m glad you found it useful.

  • @bassemkhozam
    @bassemkhozam 3 года назад

    Best RUclips channel for WordPress advanced tutorials .. thank you very much

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

    finally I understand action hooks!!!

  • @ChristopherZ11
    @ChristopherZ11 3 года назад

    no questions, you answered them all. best video on youtube for add_action()

  • @GenoFelice
    @GenoFelice 3 года назад

    Great tutorial. Best I have seen.

  • @MDHASAN-mv9cd
    @MDHASAN-mv9cd 3 года назад

    I love this kind of coding video and subscribed the channel. Keep up the good work bro🥰

  • @chonyou9155
    @chonyou9155 5 лет назад +1

    Thanks for making this tutorial about hooks. I have seen them in functions.php and did not understand them until now. Thanks very much.

  • @cmdaltctr
    @cmdaltctr 3 года назад +1

    Thank you so much for making this. I hope more will come, you have a great talent on explaining. I sincerely thank your contribution and lessons, from the top of my heart!

  • @zzpaco
    @zzpaco 3 года назад

    Very good explanations, I think I understood but will have to practice on my own examples.
    Very good job, I subscribe!

  • @mydentalscaler3462
    @mydentalscaler3462 3 года назад

    Thank you bro, you made it simple and clear to understand 😘😘

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

    Excellent video and explanations, this is very useful and helpful !!!!. thanks for sharing.

  • @rushas
    @rushas 3 года назад

    Great job! Subscribed

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

    Keep up the good work dude. Those 3K subscribers will be 300K in a year. Awesome WP content is very rare these days.
    Great presentation and tempo, you're like the Wordpress Kyle Simpson without the extra 100 pounds.

  • @Immanual-mug
    @Immanual-mug Год назад

    where have you gone kind sir!?!? would love you to continue on developing and teaching wordpress development!!

  • @45xtc
    @45xtc 4 года назад

    Great explanation.Thank you

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

      You are welcome!

  • @andreascarpa7143
    @andreascarpa7143 5 лет назад +1

    thank you, it's clear, neat, very comprehensible

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

    Very good and detailed explanation. Wish good luck with your channel.

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

    thank you man.keep going.nice and clean tutorials.

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

      You’re very welcome!

  • @Aziz-Ahmed-UK
    @Aziz-Ahmed-UK Год назад

    Thank you for the tutorial. I want to set the character limit to post title and description, do I need to create a hook for that to happen in WordPress? Do you know how to solve this problem? Thanks

  • @КирилКирилл-ю2б
    @КирилКирилл-ю2б 2 года назад +1

    Thank's for tutorials. Could you do lessons about development classifieds dashboard from scratch with own custom plugins and themes

  • @AysProPlugins
    @AysProPlugins 3 года назад

    Thanks a lot!
    In addition, do_action() function can also get more than 2 arguments.

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

    Good. I learn new thing today

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

    thank you it was very helpful, here is some points that i would love to see;
    1. metadata? (user, post and etc)
    2. creation of a page inside the admin to persist data

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

    thanks really helpful. Need to learn more about these concepts

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

    At 5:08. Why is there an exclamation point after the if statement? If it is NOT a revision or an autosave we DO want it to do something. Yet the function returns. Thanks

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

      i got confuse there. there shouldn't be ! Not sign but still that worked. anybody know why?

    • @10OzGlove
      @10OzGlove 4 года назад +1

      I just posted the same question and found you two's questions. I guess we are three now :)

  • @kornelijekovac9793
    @kornelijekovac9793 3 года назад +2

    2:23 So if I get it right, you're actually adding a function to some action? The command would be better described with:
    add_(function_to)_action ('to which action' , 'name of function to add')?

  • @tgsoon2002
    @tgsoon2002 5 лет назад +1

    Can you do this some where else beside Function.php? What is your dev environment setup? What tool do you used to develop, is that VSCode?

    • @WPCasts
      @WPCasts  5 лет назад +1

      You can put in a few places besides functions.php, but most likely a plugin file or functions.php. I have a video showing this off the tools i use here: ruclips.net/video/bn0VgekHXJo/видео.html

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

    Pretty nice, clear and practical.

  • @10OzGlove
    @10OzGlove 4 года назад +7

    Awesome video! Juts one quick question, I'm confused by your use of the negation in your php statement at 4:41.
    if(! (wp_is_post_revision( $post_id )) || wp_is_post_autosave($post_id) ) {return;} This means to me : if it is NOT a revision or if it IS an autosave then return. Could you please quickly explain this point of logic? Thank you.

    • @eddyroybalummel9869
      @eddyroybalummel9869 4 года назад +3

      "...the term "revision" in WordPress is a little confusing. It's not the updated, or revised, post... but the older version. The most updated version is the "parent."
      So, if you're calling the function wp_is_revision_post() on the current version of the post, it will always return false (and wp_get_post_parent_id() will return NULL) since the current post is not considered a "revision." You will need to call it on an actual revision, (which would have a different ID from the current version of the post)."
      wordpress.stackexchange.com/questions/188267/why-is-wp-is-post-revision-always-false

    • @10OzGlove
      @10OzGlove 4 года назад

      @@eddyroybalummel9869 Thank you for taking the time to explain this.

  • @davidionesi9207
    @davidionesi9207 3 года назад

    Beautiful!

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

    Great tutorial

  • @stavroskefaleas6320
    @stavroskefaleas6320 Год назад

    Awesome!
    For some reason I can see super secret page even if I am logged out!

  • @ahmad-ali14
    @ahmad-ali14 3 года назад

    perfect, thanks

  • @hyildiz6851
    @hyildiz6851 Год назад

    Hi, thank you so much.
    But, how are you able to get the Wordpress intelligence in Visual Studio Code? It's Visual Studio Code, isn't it???
    Thx.

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

    Hi great video, can we make section on page or in theme panel section for display post by category and post type like elemntor advance query control

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

    Great video. Please keep doing what you're doing :)

  • @noeldiaz1354
    @noeldiaz1354 3 года назад +1

    Why would I use do_action if you could've just call your new function directly?
    Example in the video you did do_action('user_redirected', date())
    isn't that the same as just: user_redirected(date())? I mean, in the end it just call the function you just created, so whats the reason to not call it directly?

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

    which wordpress autocomplete extension are you using for vscode?

  • @adante407
    @adante407 5 лет назад +1

    Great tutorial. Are you going to make any theme development from scratch tutorials? Would be great! Most of the content regarding theme development on RUclips is very outdated, or incomprehensible. Your explanations are very succinct, and concise. Some theme & plugin tutorials would be good. 👍

    • @WPCasts
      @WPCasts  5 лет назад +4

      I totally agree. Theme development has evolved quite a bit over the years. I feel like I would be a good fit for making a theme/plugin development series. Quite the undertaking, considering how large of a topic it is...but I'll consider it!

    • @SK-009
      @SK-009 4 года назад

      WPCasts oh, please do..pretty please

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

      @@WPCasts When should we expect?

  • @tschwaar
    @tschwaar 5 лет назад +1

    Hey Alex, thanks for the helpful description of Actions (and Part 2: Filters too!). What code editor are you using that has Wordpress-specific popup help and hints?

    • @WPCasts
      @WPCasts  5 лет назад +1

      I’m using Visual Studio Code with the WordPress Snippets plug-in installed.

  • @martinkaspar5095
    @martinkaspar5095 3 года назад

    hi there dear mate - thx for this. We would be excited about new vids that cover future development - WP 5.9 and topics like FSE and Query loop
    The community would celebrate this - and give you tons of clicks

  • @MrNestaho
    @MrNestaho 3 года назад

    Can somebody tell me, the $hook_name after add_action have to be a specific name or can be set arbitrary.

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

    Nice Tutorial! Which IDE do you use?

  • @moses.muchemi
    @moses.muchemi 3 года назад

    So where did the $post_id variable come from?

  • @aaazzz8418
    @aaazzz8418 3 года назад

    My VS Code does not recognize the built-in WordPress functions. And when activating my plugin, the site crashes because of the same issue. The Docker Container log of WordPress says "Php error: unknown function bla bla".

  • @gpodjoe9179
    @gpodjoe9179 3 года назад

    The save_post action hook is fired up whenever I click ‘Add New’ to add a new post instead of actually saving a post for some reason.

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

    hi there! if i want to sent email of order invoice automatic then how can i achieve these things using woocommerce hooks?

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

    Thank a lot..

  • @ericbraidy874
    @ericbraidy874 Год назад

    merci beaucoup, thx very much, but the part (if (!(wp_is_post_revision( $post_id )) || wp_is_post_autosave( $post_id ) ){return; } doesn't work for me

  • @jean-yvescyb9788
    @jean-yvescyb9788 5 лет назад

    Nice thank you!

  • @ahmedmusawir
    @ahmedmusawir 5 лет назад +1

    Learn something new from every video ... even though working with WP for a while ... this is like CRACK for a WP Brain ... :-)

    • @WPCasts
      @WPCasts  5 лет назад +1

      Thanks! I'm glad you've found it helpful :)

  • @newpattern2208
    @newpattern2208 3 года назад

    Awasome explanation .... But the pic in website at the start of vedio is distracting

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

    What about do_action_ref_array() please tell about thia

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

    Do i need to learn PHP to understand this concept better????

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

      Yes, PHP is a pre-requisite

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

    The playlist you created is in the wrong order.

  • @이하이-b3s
    @이하이-b3s 5 лет назад

    Thanks for your great tips. I have a question. If there's no action hooks on the function of plugin or theme, how can I edit function without direct editing the file? I would like to edit function of Ajax login plugin, but there's no action hooks. Is there any best practice on this case? :)

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

      Shoot. That is tough. Plugins should have SOME actions that you can tap into. Have you browsed their source code to see if they are there? Do they have any documentation?

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

    *come from reddit , Thanks*

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

    A
    W
    E
    S
    O
    M
    E

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

    Thanks, you the bomb!👍👍😆😆

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

    Thx for the comment on reddit :)

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

    Hey, nice vid - what code editor are you using?

    • @WPCasts
      @WPCasts  5 лет назад +1

      I’m using Visual Studio Code :)

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

      @@WPCasts Thanks! I've been using Atom but not in love with it. I'll try VS Code

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

    Please make a video how to solve Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'OceanWP_Header_Customizer' does not have a method 'header_image_css' in /home/owais123/public_html/wp-includes/class-wp-hook.php on line 288 error Thank you

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

    thank you =)

  • @JaehoonMe
    @JaehoonMe 3 года назад

    Thx

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

    Hey there, nice explanation. I want some help from you please..

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

    what editor is that?

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

    what's this code editor?

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

      Visual Studio Code

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

    sir kindly provide source code for this