Last active
          June 5, 2019 15:04 
        
      - 
      
- 
        Save max-kk/3de86d6911425525f4958fce19b56cc6 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| // Copy after | |
| add_shortcode('fv_prize_pool', function($atts){ | |
| global $contest_id; | |
| if ( empty($contest_id) ) { | |
| if ( !empty($atts['contest_id'])) { | |
| $contest_id = absint($atts['contest_id']); | |
| } else { | |
| return "No contest ID"; | |
| } | |
| } | |
| $count = ModelCompetitors::query() | |
| ->where("contest_id", $contest_id) | |
| ->where("status", ST_PUBLISHED) | |
| ->find(true); | |
| return $count*2; | |
| }); | |
| // Usage | |
| // Prize pool: [fv_prize_pool]$ | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment