Thanx for the reply! But I'm not kidding ... really, WP and OOP with such clarity?! Nope, you cannot find anywhere else my friend, trust me on this, I'm a youtube junky ... I hope this seriese goes up to 100 episodes!!!
Request: When you make a Vue.js course, plz use WP rest api for the Ajax calls with Axios ... There are a lot of courses out there for Vue.js but nothing that marges WP and Vue together ... special thanx in advance.
Just decided to follow these series till the end. Very good learning of both PHP and Wordpress. Love it! I am a novice in programming but love to fiddle with code and technology for my own purposes. Came across this as I have a need to build a plugin for Wordpress and I think I will have much better success if I complete this tutorial before I start with my own code. Thanks for all the efforts you put into the creation of these videos. It is very valuable for me, and many others. Thanks a million!
You rock Alessandro, I really appreciate your great work, and I really happy because you really like help people, just amazing. I think that we can improve what you did making more readably as a "Json structure" or something like that. We avoid to create more variables and waste memory, less(null) validations, etc. Is just another way to do it. And again thanks my friend. #Admin.php $this->pages = array( array( 'page_title' => 'Title', 'menu_title' => 'Title', 'capability' => 'manage_options', 'menu_slug' => 'menu_slug', 'callback' => function() { echo ':)'; }, 'icon_url' => 'dashicons-store', 'position' => 56, 'sub_pages' => array ( array ( 'page_title' => 'Child title', 'menu_title' => 'Child titln', 'menu_slug' => 'can-be-different-slug', 'callback' => function() { echo ' Hi! '; }, ) ) ) ); #SettingsApi.php public function addAdminMenu() { foreach ( $this->admin_pages as $page ) { add_menu_page( $page['page_title'], $page['menu_title'], $page['capability'], $page['menu_slug'], $page['callback'], $page['icon_url'], $page['position'] ); foreach ( $page['sub_pages'] as $subpage ) { add_submenu_page( $page['menu_slug'], $subpage['page_title'], $subpage['menu_title'], $page['capability'], $subpage['menu_slug'], $subpage['callback'] ); } } }
Thanks for the tuts! After I have been watching your videos from 1 to 15 (about 5 hours long), and yet I only see your main concern is to make the code beautiful. I still have not yet get any clue to do CRUD on the admin section. Perhaps it would be a good idea to separate the videos in making it work and making it beautiful. However, I indeed thankful for these videos, and gave thumbs up!
Hi Alessandro, thanks for your tutorials, i just start started following this plugin tutorial and they are so nice and explanatory but there is something i dont understand yet about plugin development, i saw a tutorial about extending a class called widget, i hope you can make a tutorial about that and create a widget plugin, probably a very simple example...
For those who has this error "Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given,", check the accepted answer from here: stackoverflow.com/questions/4103480/how-to-resolve-must-be-an-instance-of-string-string-given-prior-to-php-7 Basically just remove the type check "string", or do the checking inside the function. Hope this helps.
I know this code is a bit old, I just uploaded the git repository code for this class "Lesson 15" but I can't see the submenus, I also don't see any errors in the console, I'm using Wordpress Version 5.4.1 PHP 7.2
@@lenny99mc Do cross check with the git repository codes. I just figure out my code is just missing 's' in capability manage_options which i write manage_option.
Hi, I have double checked with the gitub repo and my files are the same. I get the error, "Sorry, not allowed to access this page" when I try to get to the sub page. Everything else works. The sub page shows up in the sidebar, but I am not allowed to access it?! Any ideas? Now I'm getting that it cannot load the subpage when I click on it.
Mhh, that's weird. If you copied my code and you're logged in as admin, you shouldn't have issues in accessing the page you created. Can you try lowering the required capabilities to something a regular user can access.
I kept getting 500 internal server error when accessing the subpage. It said "cannot load page". Changing capabilities for subpage didn't work. I fixed it by replacing my wp-includes and wp-admin folders with the latest wordpress install. Must have been some corrupt files or something with the wordpress installation. Weird! But it works now. Thank for all the great tutorials! :) Have a great day!
It seems that the method "withSubpage" is not required, we can define all the subpages information together in the Admin.php. am I right ? what do you think? Anyway , this is a really amazing tutorials.
I think there is subtle logic error on "withSubPage" function. Because we create "withSubPage" to create the first tab of Admin MenuS. HOWEVER we might have not one but several admin menus which you already defined admin menu pages as an array. But ""withSubPage" only sub menu for the first page is created. I think it should be modified in a way that it will create first submenus of admin pages not for JUST THE FIRST page but also for the other pages that we want. So to fulfill this we can add an array as second parameter which will take the list admin pages that we want submenus to be added. For example second parameter will be smth. such as [1,0,1,0,0] then we will add sub menu for the first and third admin menu page. No sub menu will be added for the second , forth and fifth admin pages. So on.
If I add two admin menus with submenus, it only shows "Dashboard" on the top menu. If I changed SettingsApi.php $admin_page = $this->admin_pages[0]; to $admin_page = $this->admin_pages[1]; it would show "Dashboard on the second menu. Is there a way to get this to show "Dashboard on all menus?
By the way, your videos are the most educational I have found and the most useful. I've taken classes on Udemy that aren't even close to this. Thanks for providing these tutorials!!!
Most of the plugins will have only 1 admin menu and 1 dashboard and maybe a few subpages. So even though the design is not flawless but it's useful 99.9% of the time :)
My approach is a little bit different from Alessandro, if I need more than 1 admin menu I'll create 2 different classes in Pages folder (ie. Admin.php and SomeOtherPage.php) because I think that Admin.php should only have 1 main menu, if I need more I'll just add another file inside Pages
hey there , I wrote my code exactly like you even we can say copy pest . But My output is not give me result like you plezzz reply me it would be very grateful. ..?
this error Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given, called in C:\xampp\htdocs\wordpress\wp-content\plugins\alecaddd-plugin\inc\Pages\Admin.php on line 67 and defined in C:\xampp\htdocs\wordpress\wp-content\plugins\alecaddd-plugin\inc\Api\SettingsApi.php on line 27 how to fix it.
what is the purpose of merging an array ? if you don't merge if you skip merging step still you will get the same end result as you want ... i am getting confused with the merging array concept, i am sure there will be someone else as well .
Hello.. Can you tell me how to create wp_list_table from the callback. I feel confused to create it with your way. But I like your way beacuse it's so good to read and also clean..
1. I think using 'setPages' instead of 'public function addPages( array $pages )' would have been a better choice because there is nothig incremental, pages completely are set at once. (at SettingsApi.php) 2. Is it a wordpress necessity that parent plugin menu and first plugin SUB-MENU should point to the same page?
may it does not work with the wordpress update inkl gutenberg? pages works but subpages not? i checked all files also with yours in github nothing found...
Nice tutorials, I'm following you from the beginning and it is going well, but in this tutorial I have an error: Recoverable fatal error: Object of class Closure could not be converted to string in /home/blabla/public_html/blabla/wp-includes/functions.php on line 1712. Could you please help me about this.
Hello im stuck please help... TIA this code is working, but its not renaming the subpage. its just outputting the [menu_slug]. $this->settings->addPages( $this->pages )->withSubPage()->addSubPages( $this->subpages )->register(); and this code is not working. every time im adding the 'Dashboard' my code is not working. $this->settings->addPages( $this->pages )->withSubPage('Dashboard')->addSubPages( $this->subpages )->register(); I got this Error: Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given,
I am getting this error. Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given The line causing it is: $this->settings->addPages( $this->pages )->withSubPage( 'Dashboard' )->addSubPages( $this->subpages )->register(); It has a problem with the parameter of withSubPage(). Can anyone help? Alecadd seems to not have this problem and I wrote exactly what he wrote. Thanks in advance!
Hello im trying to do this video, im following this course from first video and everything is ok... but in this f*** video i was two days stucked... XDDDDD... can you help me please Ale? i do all stuff in that video i review it to check the code and all is fine, my page is working, but no submenu appears in WP desktop... by the way... thank you so much by helping every us with your videos
I had the same issue. It turns out, the menu_slug of the admin page, and parent_slug for my submenus didn't match. Once I changed that, everything was fine.
Yeah, that's just mind blowing. I feel like I'm learning so much, there's a lot happening on these videos, I can't lose focus even for a moment because I will get lost and also lose knowledge
Hello Alex, Thanks for your amazing work. I get this error message: Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given, called in C:\wamp\www\website.com\wp-content\plugins\Aim-High-plugin\includes\Pages\Admin.php on line 32 and defined in C:\wamp\www\website.com\wp-content\plugins\Aim-High-plugin\includes\Api\SettingsApi.php on line 20 line 32: (Admin.php) $this->settings->addPages( $this->pages)->withSubPage('Dashboard')->register(); line 20: (SettingsApi.php) public function withSubPage( string $title = null ){ ps, This is before executing the final step (->addSubPages)
Mh, that's weird. Did you check my source code on Github to see if you have any issues? I wonder if it's a Wamp issue. What version of PHP are you running?
The 5.5.12 version .. i will check the code again and again but if the problem is because of the version tell me please .. many thanks for your help Alessandro
Warning: strpos() expects parameter 1 to be string, object given in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 5230 Warning: preg_match() expects parameter 2 to be string, object given in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 5239 Recoverable fatal error: Object of class Closure could not be converted to string in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 1720 i dont know what ar those, i try to debug it but all works good, i dont get it
You can still get subpages without the method of withSubpage(). $this->settings->addPages( $this->pages )->addSubPages( $this->subpages)->register(); If you want to change the default sub-menu title, you should use withSubpage('Whatever title you want' ). So I think this method should be named withCustomTitle('Dashboard') "Happy Coding " ...
Nice videos. But Please stop showing the wrong way to do things then the right way or the way you want to do it. Just show us the best way from your perspective. Otherwise, its confusing, time consuming and maddening if we are following along then have to change everything. People are busy, with kids or everything else that distracts them on a daily basis. So redoing work already done is problematic for those folks. I am one of them. Again. GREAT VIDEOS otherwise.
Thanks for your comment and for your feedback. I like to teach the way I like to learn, by knowing what I'm doing and why I'm doing it. I think showing common mistakes and bad approaches is important to properly learn to code. I'll try to improve the quality of my videos nonetheless. Cheers
@@alecaddd That's in fact slightly irritating, but I think both approaches are good methods. I think the method shown is the harder way of learning but also the most rewarding
This is mind blowing!! Never before anything like this was done on the Net!!! WoW!!! Plz, keep 'em coming ... thx a bunch!!
Ahahaha, I love your excitement, thanks for watching :D
Thanx for the reply! But I'm not kidding ... really, WP and OOP with such clarity?! Nope, you cannot find anywhere else my friend, trust me on this, I'm a youtube junky ... I hope this seriese goes up to 100 episodes!!!
Request: When you make a Vue.js course, plz use WP rest api for the Ajax calls with Axios ... There are a lot of courses out there for Vue.js but nothing that marges WP and Vue together ... special thanx in advance.
Just decided to follow these series till the end. Very good learning of both PHP and Wordpress. Love it! I am a novice in programming but love to fiddle with code and technology for my own purposes. Came across this as I have a need to build a plugin for Wordpress and I think I will have much better success if I complete this tutorial before I start with my own code. Thanks for all the efforts you put into the creation of these videos. It is very valuable for me, and many others. Thanks a million!
You deserve an Oscar for the brilliant work you've done.
Am I the only one who likes the video first and proceed?
Many, many thanks to you, man!
But what if the video is actually terrible? :P
@@alecaddd You're a BRAND, a quality brand.
I repeat myself but your tutorials are amazing!
I'll never get tired of reading this, so, please, keep repeating yourself :P
my english isn't enough to have conversation, but i understood everything that you said. Thank you for amazing video
Cheers
Amazing quality as always
You rock Alessandro, I really appreciate your great work, and I really happy because you really like help people, just amazing. I think that we can improve what you did making more readably as a "Json structure" or something like that. We avoid to create more variables and waste memory, less(null) validations, etc. Is just another way to do it. And again thanks my friend.
#Admin.php
$this->pages = array(
array(
'page_title' => 'Title',
'menu_title' => 'Title',
'capability' => 'manage_options',
'menu_slug' => 'menu_slug',
'callback' => function() { echo ':)'; },
'icon_url' => 'dashicons-store',
'position' => 56,
'sub_pages' => array (
array (
'page_title' => 'Child title',
'menu_title' => 'Child titln',
'menu_slug' => 'can-be-different-slug',
'callback' => function() { echo ' Hi! '; },
)
)
)
);
#SettingsApi.php
public function addAdminMenu() {
foreach ( $this->admin_pages as $page ) {
add_menu_page( $page['page_title'],
$page['menu_title'],
$page['capability'],
$page['menu_slug'],
$page['callback'],
$page['icon_url'],
$page['position']
);
foreach ( $page['sub_pages'] as $subpage ) {
add_submenu_page( $page['menu_slug'],
$subpage['page_title'],
$subpage['menu_title'],
$page['capability'],
$subpage['menu_slug'],
$subpage['callback']
);
}
}
}
Sure, you can edit the code to better fit your needs.
Happy Coding!
Amazing! These videos improved my plugins development skill.
Thanks for the tuts! After I have been watching your videos from 1 to 15 (about 5 hours long), and yet I only see your main concern is to make the code beautiful. I still have not yet get any clue to do CRUD on the admin section. Perhaps it would be a good idea to separate the videos in making it work and making it beautiful. However, I indeed thankful for these videos, and gave thumbs up!
Can't thank you enough! the course is great and it helped me so much to be able to get the source code from github. Thanks again!
Cheers
Thanks for your tutorials!
Great tutorial! Thanks. Instead of using arrays of arrays I would suggest writting a Page class and a SubPage class
You're definetely the best! Thanks for so good content!
Thanks buddy! I've been doing this tutorial and are awesome!!
Thanks for watching :D
Great tutorial!
You can also write the null check as: *'menu_title' => $title ?? $admin_page['menu_title']*
Oh cool, yeah I forgot about this shorthand, thanks for sharing
Nice shortcut!
Hi Alessandro, thanks for your tutorials, i just start started following this plugin tutorial and they are so nice and explanatory but there is something i dont understand yet about plugin development, i saw a tutorial about extending a class called widget, i hope you can make a tutorial about that and create a widget plugin, probably a very simple example...
Yes, I'm gonna build some Widgets in this series and I'll explain how the Widget class of WordPress works and why/how to extend it.
Cheers
yeah cheers, thanks once again...
yeah super waiting for next video
Coming in a couple of days :D
PFF.. I confirm. This is excellent stuff!
Thanks
very very useful, thanks so much Alessandro
You're very welcome, thanks for watching :D
Keep up good work, thanks
Cheers
For those who has this error "Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given,", check the accepted answer from here: stackoverflow.com/questions/4103480/how-to-resolve-must-be-an-instance-of-string-string-given-prior-to-php-7 Basically just remove the type check "string", or do the checking inside the function. Hope this helps.
Thanks for sharing
Oh man you are the wizzard of OZ!
Ahaha, thanks :D
I know this code is a bit old, I just uploaded the git repository code for this class "Lesson 15" but I can't see the submenus, I also don't see any errors in the console, I'm using Wordpress Version 5.4.1 PHP 7.2
Hey I have the same problem, did you already find out wat is was?
same here
@@lenny99mc Do cross check with the git repository codes. I just figure out my code is just missing 's' in capability manage_options which i write manage_option.
Hi, I have double checked with the gitub repo and my files are the same. I get the error, "Sorry, not allowed to access this page" when I try to get to the sub page. Everything else works. The sub page shows up in the sidebar, but I am not allowed to access it?! Any ideas? Now I'm getting that it cannot load the subpage when I click on it.
Mhh, that's weird. If you copied my code and you're logged in as admin, you shouldn't have issues in accessing the page you created.
Can you try lowering the required capabilities to something a regular user can access.
I kept getting 500 internal server error when accessing the subpage. It said "cannot load page". Changing capabilities for subpage didn't work. I fixed it by replacing my wp-includes and wp-admin folders with the latest wordpress install. Must have been some corrupt files or something with the wordpress installation. Weird!
But it works now.
Thank for all the great tutorials! :) Have a great day!
Oh wow, that's really strange. Well, I'm glad you solved it and it wasn't my fault :D
Happy Coding
why you should make a booking appoinment plugin ? . I think it's a cool topic
It seems that the method "withSubpage" is not required, we can define all the subpages information together in the Admin.php. am I right ? what do you think? Anyway , this is a really amazing tutorials.
Does 2 class with same name will give an error
I think there is subtle logic error on "withSubPage" function. Because we create "withSubPage" to create the first tab of Admin MenuS. HOWEVER we might have not one but several admin menus which you already defined admin menu pages as an array. But ""withSubPage" only sub menu for the first page is created. I think it should be modified in a way that it will create first submenus of admin pages not for JUST THE FIRST page but also for the other pages that we want. So to fulfill this we can add an array as second parameter which will take the list admin pages that we want submenus to be added. For example second parameter will be smth. such as [1,0,1,0,0] then we will add sub menu for the first and third admin menu page. No sub menu will be added for the second , forth and fifth admin pages. So on.
Sure, that's a good point, feel free to update the code as you like or as it fits your needs.
If I add two admin menus with submenus, it only shows "Dashboard" on the top menu. If I changed SettingsApi.php $admin_page = $this->admin_pages[0]; to $admin_page = $this->admin_pages[1]; it would show "Dashboard on the second menu. Is there a way to get this to show "Dashboard on all menus?
Oh yes, it's a little bug with my structure. I will release an update video soon to tackle this issue. Thanks for the comment.
By the way, your videos are the most educational I have found and the most useful. I've taken classes on Udemy that aren't even close to this. Thanks for providing these tutorials!!!
You're very welcome, I'm glad my videos are useful for you. Happy Coding :D
Most of the plugins will have only 1 admin menu and 1 dashboard and maybe a few subpages. So even though the design is not flawless but it's useful 99.9% of the time :)
My approach is a little bit different from Alessandro, if I need more than 1 admin menu I'll create 2 different classes in Pages folder (ie. Admin.php and SomeOtherPage.php) because I think that Admin.php should only have 1 main menu, if I need more I'll just add another file inside Pages
hey there , I wrote my code exactly like you even we can say copy pest . But My output is not give me result like you plezzz reply me it would be very grateful. ..?
this error
Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given, called in C:\xampp\htdocs\wordpress\wp-content\plugins\alecaddd-plugin\inc\Pages\Admin.php on line 67 and defined in C:\xampp\htdocs\wordpress\wp-content\plugins\alecaddd-plugin\inc\Api\SettingsApi.php on line 27
how to fix it.
what is the purpose of merging an array ? if you don't merge if you skip merging step still you will get the same end result as you want ... i am getting confused with the merging array concept, i am sure there will be someone else as well .
Hello.. Can you tell me how to create wp_list_table from the callback. I feel confused to create it with your way. But I like your way beacuse it's so good to read and also clean..
1. I think using 'setPages' instead of 'public function addPages( array $pages )' would have been a better choice because there is nothig incremental, pages completely are set at once. (at SettingsApi.php) 2. Is it a wordpress necessity that parent plugin menu and first plugin SUB-MENU should point to the same page?
1. Sure, you can change the code however you want.
2. Yup
Why did you define $title in this function - public function withSubPages(string $title = null)
Have learnt a lot :)....thank you soooo much
thanks you very much it really help me thanks again
Happy to hear that :D
Hi I am following your series it's great and it's all good till now but I cant add submenu somehow n there is no error, can you please help.
Check my source code on GitHub if you have any issues.
subpages not working here, no php error and i cannot find the failure i did everthing as in video but not working pages works but subpages not ...
may it does not work with the wordpress update inkl gutenberg? pages works but subpages not? i checked all files also with yours in github nothing found...
OMG i found the failure :-) it was the parent_slug!! i did not write correct the parent_slug in the subpages
I'm glad you found the issue
Nice tutorials, I'm following you from the beginning and it is going well, but in this tutorial I have an error: Recoverable fatal error: Object of class Closure could not be converted to string in /home/blabla/public_html/blabla/wp-includes/functions.php on line 1712. Could you please help me about this.
Check my source code on Github, probably you have a typo somewhere.
Happy Coding :D
Hello im stuck please help... TIA
this code is working, but its not renaming the subpage. its just outputting the [menu_slug].
$this->settings->addPages( $this->pages )->withSubPage()->addSubPages( $this->subpages )->register();
and this code is not working. every time im adding the 'Dashboard' my code is not working.
$this->settings->addPages( $this->pages )->withSubPage('Dashboard')->addSubPages( $this->subpages )->register();
I got this Error:
Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given,
Check my source code on GitHub to see if you have any typos or mistakes. Cheers
I got it, Thanks.
I really love your tutorials.
How did you resolve the error?
I removed the "string" in $title =null and it works fine.
I dont know if its ok to do that.
I am getting this error.
Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given
The line causing it is:
$this->settings->addPages( $this->pages )->withSubPage( 'Dashboard' )->addSubPages( $this->subpages )->register();
It has a problem with the parameter of withSubPage(). Can anyone help? Alecadd seems to not have this problem and I wrote exactly what he wrote.
Thanks in advance!
No need to send me also an email :P
Did you check my source code on GitHub? Are you sure everything is identical to mine?
Ok. Won't send you again. I just wanted a response quickly.
But yeah, I did check and everything is identical. But I will check again.
Thanks.
Hello im trying to do this video, im following this course from first video and everything is ok... but in this f*** video i was two days stucked... XDDDDD... can you help me please Ale? i do all stuff in that video i review it to check the code and all is fine, my page is working, but no submenu appears in WP desktop... by the way... thank you so much by helping every us with your videos
im so sorry i found the error... simply i have to put the same capability to page and submenues.... Thanks a lot, you`re the best!!
I had the same issue. It turns out, the menu_slug of the admin page, and parent_slug for my submenus didn't match. Once I changed that, everything was fine.
Awesome but very difficult to understand
Yeah, that's just mind blowing. I feel like I'm learning so much, there's a lot happening on these videos, I can't lose focus even for a moment because I will get lost and also lose knowledge
nice!
Hello Alex, Thanks for your amazing work.
I get this error message:
Catchable fatal error: Argument 1 passed to Inc\Api\SettingsApi::withSubPage() must be an instance of Inc\Api\string, string given, called in C:\wamp\www\website.com\wp-content\plugins\Aim-High-plugin\includes\Pages\Admin.php on line 32 and defined in C:\wamp\www\website.com\wp-content\plugins\Aim-High-plugin\includes\Api\SettingsApi.php on line 20
line 32: (Admin.php)
$this->settings->addPages( $this->pages)->withSubPage('Dashboard')->register();
line 20: (SettingsApi.php)
public function withSubPage( string $title = null ){
ps, This is before executing the final step (->addSubPages)
Mh, that's weird. Did you check my source code on Github to see if you have any issues?
I wonder if it's a Wamp issue. What version of PHP are you running?
The 5.5.12 version .. i will check the code again and again but if the problem is because of the version tell me please .. many thanks for your help Alessandro
For these OOP settings, would be recommended to have PHP higher than 5.6
Version 7 would be the best.
How are you displaying the php errors? my site just crashes???
enable wp_debug google it
Warning: strpos() expects parameter 1 to be string, object given in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 5230
Warning: preg_match() expects parameter 2 to be string, object given in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 5239
Recoverable fatal error: Object of class Closure could not be converted to string in C:\Users\leadsoft\Desktop\xaamp\htdocs\wordpress-4.9.8\wordpress\wp-includes\functions.php on line 1720
i dont know what ar those, i try to debug it but all works good, i dont get it
for those how have this error just put $page['parent_slug'] in add_submenu_page, that was the problem, fk it :(
Please create a simple plugin using FPDF that create pdf file with client style ( like logo , title in pdf file )
Thanks :D
Mh, I don't think I'll do that, but I'm sure at the end of this series, you'll have the necessary knowledge to make it yourself :D
Okay then I will wait for that time .. :D
Thanks :D
You can still get subpages without the method of withSubpage().
$this->settings->addPages( $this->pages )->addSubPages( $this->subpages)->register();
If you want to change the default sub-menu title, you should use withSubpage('Whatever title you want' ).
So I think this method should be named withCustomTitle('Dashboard')
"Happy Coding " ...
Nice videos. But Please stop showing the wrong way to do things then the right way or the way you want to do it. Just show us the best way from your perspective. Otherwise, its confusing, time consuming and maddening if we are following along then have to change everything. People are busy, with kids or everything else that distracts them on a daily basis. So redoing work already done is problematic for those folks. I am one of them. Again. GREAT VIDEOS otherwise.
Thanks for your comment and for your feedback. I like to teach the way I like to learn, by knowing what I'm doing and why I'm doing it. I think showing common mistakes and bad approaches is important to properly learn to code. I'll try to improve the quality of my videos nonetheless. Cheers
@@alecaddd That's in fact slightly irritating, but I think both approaches are good methods. I think the method shown is the harder way of learning but also the most rewarding