• I tried my hand at making a small plugin that basically has one shortcode command in it. I do a lot of copying and pasting on my site and wanted to simplify the process; but, I’m getting header errors and when I activate the plugin, it messes up my events_planner plugin, saying that headers have already been sent. I have looked for some more info; but, nothing has helped thusfar.

    Here’s my code:

    <?php
    /* Plugin Name: Unsigned
    Version: 0.1
    Description: Testing out plugin development
    Author: Christian King
    Author URI: https://www.theunsignedsounds.com
    Plugin URI: https://theunsignedsounds.com */?>
    
    <?php
    //[unreview] TEMPLATE SHORTCODE
    function unreview_func( $atts ){
    
    	extract( shortcode_atts( array(
    		'artist'=> 'artistname',
    
    		), $atts ) );
    
    	$audiolink = "https://theunsignedsounds.com/audio/".$artist.".mp3";
    	$audio = "[audio src='".$audiolink."']";
    
    	echo $audio;
    }
    add_shortcode( 'unreview', 'unreview_func' );
    ?>
  • The topic ‘1st attempt at plugin/shortcodes" FAIL’ is closed to new replies.