Custom button in Wordpress Dashboard











up vote
0
down vote

favorite












We would like to create a custom button in the wordpress dashboard,



We want this button to hold our pages we create for clients,



Because I want to keep the pages section separate from our "Client" pages



enter image description here



i hope this makes sense










share|improve this question


























    up vote
    0
    down vote

    favorite












    We would like to create a custom button in the wordpress dashboard,



    We want this button to hold our pages we create for clients,



    Because I want to keep the pages section separate from our "Client" pages



    enter image description here



    i hope this makes sense










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      We would like to create a custom button in the wordpress dashboard,



      We want this button to hold our pages we create for clients,



      Because I want to keep the pages section separate from our "Client" pages



      enter image description here



      i hope this makes sense










      share|improve this question













      We would like to create a custom button in the wordpress dashboard,



      We want this button to hold our pages we create for clients,



      Because I want to keep the pages section separate from our "Client" pages



      enter image description here



      i hope this makes sense







      wordpress






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 16:25









      Lewis Boxer

      105




      105
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          It's really quite straight forward, just takes a bit of getting used to.



          You ideally need to follow the docs:



          https://codex.wordpress.org/Adding_Administration_Menus
          https://developer.wordpress.org/reference/functions/add_menu_page/



          This will guide you in how to set up an admin menu.



          <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>


          Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.



          What I think you are looking for though, is a Custom Post Type for your clients...



          https://codex.wordpress.org/Post_Types



          function create_post_type() {
          register_post_type( 'client_posttype',
          array(
          'labels' => array(
          'name' => __( 'Clients' ),
          'singular_name' => __( 'Client' )
          ),
          'public' => true,
          'has_archive' => true,
          )
          );
          }
          add_action( 'init', 'create_post_type' );


          Something similar to above will get you started.



          If it's all a bit much, you can generate CPT code:



          https://generatewp.com/post-type/



          Then have a look at the generated code to work out what it is that you would have coded yourself.






          share|improve this answer




























            up vote
            0
            down vote













            Test this :)



            class options_page {

            function __construct() {
            add_action( 'admin_menu', array( $this, 'admin_menu' ) );
            }

            function admin_menu() {
            add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
            }

            function settings_page() {
            echo 'This is the page content';
            }
            }

            new options_page;





            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416445%2fcustom-button-in-wordpress-dashboard%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              It's really quite straight forward, just takes a bit of getting used to.



              You ideally need to follow the docs:



              https://codex.wordpress.org/Adding_Administration_Menus
              https://developer.wordpress.org/reference/functions/add_menu_page/



              This will guide you in how to set up an admin menu.



              <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>


              Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.



              What I think you are looking for though, is a Custom Post Type for your clients...



              https://codex.wordpress.org/Post_Types



              function create_post_type() {
              register_post_type( 'client_posttype',
              array(
              'labels' => array(
              'name' => __( 'Clients' ),
              'singular_name' => __( 'Client' )
              ),
              'public' => true,
              'has_archive' => true,
              )
              );
              }
              add_action( 'init', 'create_post_type' );


              Something similar to above will get you started.



              If it's all a bit much, you can generate CPT code:



              https://generatewp.com/post-type/



              Then have a look at the generated code to work out what it is that you would have coded yourself.






              share|improve this answer

























                up vote
                0
                down vote













                It's really quite straight forward, just takes a bit of getting used to.



                You ideally need to follow the docs:



                https://codex.wordpress.org/Adding_Administration_Menus
                https://developer.wordpress.org/reference/functions/add_menu_page/



                This will guide you in how to set up an admin menu.



                <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>


                Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.



                What I think you are looking for though, is a Custom Post Type for your clients...



                https://codex.wordpress.org/Post_Types



                function create_post_type() {
                register_post_type( 'client_posttype',
                array(
                'labels' => array(
                'name' => __( 'Clients' ),
                'singular_name' => __( 'Client' )
                ),
                'public' => true,
                'has_archive' => true,
                )
                );
                }
                add_action( 'init', 'create_post_type' );


                Something similar to above will get you started.



                If it's all a bit much, you can generate CPT code:



                https://generatewp.com/post-type/



                Then have a look at the generated code to work out what it is that you would have coded yourself.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  It's really quite straight forward, just takes a bit of getting used to.



                  You ideally need to follow the docs:



                  https://codex.wordpress.org/Adding_Administration_Menus
                  https://developer.wordpress.org/reference/functions/add_menu_page/



                  This will guide you in how to set up an admin menu.



                  <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>


                  Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.



                  What I think you are looking for though, is a Custom Post Type for your clients...



                  https://codex.wordpress.org/Post_Types



                  function create_post_type() {
                  register_post_type( 'client_posttype',
                  array(
                  'labels' => array(
                  'name' => __( 'Clients' ),
                  'singular_name' => __( 'Client' )
                  ),
                  'public' => true,
                  'has_archive' => true,
                  )
                  );
                  }
                  add_action( 'init', 'create_post_type' );


                  Something similar to above will get you started.



                  If it's all a bit much, you can generate CPT code:



                  https://generatewp.com/post-type/



                  Then have a look at the generated code to work out what it is that you would have coded yourself.






                  share|improve this answer












                  It's really quite straight forward, just takes a bit of getting used to.



                  You ideally need to follow the docs:



                  https://codex.wordpress.org/Adding_Administration_Menus
                  https://developer.wordpress.org/reference/functions/add_menu_page/



                  This will guide you in how to set up an admin menu.



                  <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ); ?>


                  Will be the code you call when creating the admin sidebar menu item, however, there are more functions for create sub menu pages under it etc.



                  What I think you are looking for though, is a Custom Post Type for your clients...



                  https://codex.wordpress.org/Post_Types



                  function create_post_type() {
                  register_post_type( 'client_posttype',
                  array(
                  'labels' => array(
                  'name' => __( 'Clients' ),
                  'singular_name' => __( 'Client' )
                  ),
                  'public' => true,
                  'has_archive' => true,
                  )
                  );
                  }
                  add_action( 'init', 'create_post_type' );


                  Something similar to above will get you started.



                  If it's all a bit much, you can generate CPT code:



                  https://generatewp.com/post-type/



                  Then have a look at the generated code to work out what it is that you would have coded yourself.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 21 at 16:32









                  Dammeul

                  791515




                  791515
























                      up vote
                      0
                      down vote













                      Test this :)



                      class options_page {

                      function __construct() {
                      add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                      }

                      function admin_menu() {
                      add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
                      }

                      function settings_page() {
                      echo 'This is the page content';
                      }
                      }

                      new options_page;





                      share|improve this answer



























                        up vote
                        0
                        down vote













                        Test this :)



                        class options_page {

                        function __construct() {
                        add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                        }

                        function admin_menu() {
                        add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
                        }

                        function settings_page() {
                        echo 'This is the page content';
                        }
                        }

                        new options_page;





                        share|improve this answer

























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Test this :)



                          class options_page {

                          function __construct() {
                          add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                          }

                          function admin_menu() {
                          add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
                          }

                          function settings_page() {
                          echo 'This is the page content';
                          }
                          }

                          new options_page;





                          share|improve this answer














                          Test this :)



                          class options_page {

                          function __construct() {
                          add_action( 'admin_menu', array( $this, 'admin_menu' ) );
                          }

                          function admin_menu() {
                          add_menu_page( 'Clients', 'Clients Page', 'edit_posts', 'clients_page', 'my_clients', '', 24);
                          }

                          function settings_page() {
                          echo 'This is the page content';
                          }
                          }

                          new options_page;






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 21 at 16:46

























                          answered Nov 21 at 16:38









                          Sco

                          1665




                          1665






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416445%2fcustom-button-in-wordpress-dashboard%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Futebolista

                              Lallio

                              Jornalista