Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
programmieren:wordpress:klassische_metabox_fuer_posts_erstellen [2023/06/14 19:24] – created jgehrkeprogrammieren:wordpress:klassische_metabox_fuer_posts_erstellen [2023/06/15 08:42] (current) jgehrke
Line 4: Line 4:
  
 <code php> <code php>
-/* +<?php 
- METABOX EINKLINGEN +/*  Metabox init */ 
- */ +new MetaboxPost();
-new MetaboxPostMarketo();+
  
 /** /**
- SEITEN EIGENSCHAFTEN+ METABOX KLASSE
  */  */
-class MetaboxPostMarketo+class MetaboxPost
 { {
  
- function __construct( $plugin_url, $plugin_path )+ function __construct( )
  {  {
- 
- $this->plugin_url  = $plugin_url; 
- $this->plugin_path = $plugin_path; 
- 
  add_action( 'add_meta_boxes', [ $this, 'add_meta_box' ] );  add_action( 'add_meta_boxes', [ $this, 'add_meta_box' ] );
  add_action( 'save_post', [ $this, 'save' ] );  add_action( 'save_post', [ $this, 'save' ] );
Line 27: Line 22:
  public function add_metabox()  public function add_metabox()
  {  {
- $mb_id            = 'moewe_mb_post_marketo'; + $mb_id            = 'plugin_metbox_name'; 
- $mb_title         = 'Marketo Verbindung';+ $mb_title         = 'Meine Metabox';
  $mb_callback      = [ $this, 'render_metabox' ];  $mb_callback      = [ $this, 'render_metabox' ];
  $mb_screens       = ['post','event'];  $mb_screens       = ['post','event'];
Line 37: Line 32:
  }  }
  
- public function register_scripts_styles(){ 
- // @see setup/admin_css_js.php 
- } 
  
  public function render_metabox()  public function render_metabox()
  {  {
- // @see setup/admin_css_js.php + echo "<p>HTML Ausgabe der Metabox</p>";
- //wp_enqueue_script( 'alpine-js' ); +
- echo "<p>Test</p>";+
  }  }
  

Page Tools